create-vite-extra 0.1.9 → 1.0.1

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 (123) hide show
  1. package/README.md +31 -21
  2. package/index.js +167 -14
  3. package/package.json +1 -1
  4. package/template-deno-lit/_gitignore +24 -0
  5. package/template-deno-lit/vite.config.mjs +3 -4
  6. package/template-deno-lit-ts/README.md +30 -0
  7. package/template-deno-lit-ts/_gitignore +24 -0
  8. package/template-deno-lit-ts/deno.json +6 -0
  9. package/template-deno-lit-ts/index.html +16 -0
  10. package/template-deno-lit-ts/public/vite-deno.svg +36 -0
  11. package/template-deno-lit-ts/public/vite.svg +1 -0
  12. package/template-deno-lit-ts/src/assets/lit.svg +1 -0
  13. package/template-deno-lit-ts/src/index.css +40 -0
  14. package/template-deno-lit-ts/src/my-element.ts +126 -0
  15. package/template-deno-lit-ts/src/vite-env.d.ts +1 -0
  16. package/template-deno-lit-ts/tsconfig.json +6 -0
  17. package/template-deno-lit-ts/vite.config.mts +16 -0
  18. package/template-deno-preact/_gitignore +24 -0
  19. package/template-deno-preact/vite.config.mjs +1 -1
  20. package/template-deno-preact-ts/README.md +30 -0
  21. package/template-deno-preact-ts/_gitignore +24 -0
  22. package/template-deno-preact-ts/deno.json +8 -0
  23. package/template-deno-preact-ts/index.html +13 -0
  24. package/template-deno-preact-ts/public/vite-deno.svg +36 -0
  25. package/template-deno-preact-ts/public/vite.svg +1 -0
  26. package/template-deno-preact-ts/src/app.css +25 -0
  27. package/template-deno-preact-ts/src/app.tsx +33 -0
  28. package/template-deno-preact-ts/src/assets/preact.svg +1 -0
  29. package/template-deno-preact-ts/src/index.css +70 -0
  30. package/template-deno-preact-ts/src/main.tsx +5 -0
  31. package/template-deno-preact-ts/src/vite-env.d.ts +1 -0
  32. package/template-deno-preact-ts/vite.config.mts +10 -0
  33. package/template-deno-react/_gitignore +24 -0
  34. package/template-deno-react/vite.config.mjs +2 -2
  35. package/template-deno-react-ts/README.md +30 -0
  36. package/template-deno-react-ts/_gitignore +24 -0
  37. package/template-deno-react-ts/deno.json +8 -0
  38. package/template-deno-react-ts/index.html +13 -0
  39. package/template-deno-react-ts/public/vite-deno.svg +36 -0
  40. package/template-deno-react-ts/public/vite.svg +1 -0
  41. package/template-deno-react-ts/src/App.css +41 -0
  42. package/template-deno-react-ts/src/App.tsx +35 -0
  43. package/template-deno-react-ts/src/assets/react.svg +1 -0
  44. package/template-deno-react-ts/src/index.css +70 -0
  45. package/template-deno-react-ts/src/main.tsx +10 -0
  46. package/template-deno-react-ts/src/vite-env.d.ts +1 -0
  47. package/template-deno-react-ts/vite.config.mts +10 -0
  48. package/template-deno-solid/_gitignore +24 -0
  49. package/template-deno-solid/vite.config.mjs +2 -2
  50. package/template-deno-solid-ts/README.md +30 -0
  51. package/template-deno-solid-ts/_gitignore +24 -0
  52. package/template-deno-solid-ts/deno.json +8 -0
  53. package/template-deno-solid-ts/index.html +13 -0
  54. package/template-deno-solid-ts/public/vite-deno.svg +36 -0
  55. package/template-deno-solid-ts/public/vite.svg +1 -0
  56. package/template-deno-solid-ts/src/App.css +26 -0
  57. package/template-deno-solid-ts/src/App.tsx +35 -0
  58. package/template-deno-solid-ts/src/assets/solid.svg +1 -0
  59. package/template-deno-solid-ts/src/index.css +70 -0
  60. package/template-deno-solid-ts/src/main.tsx +7 -0
  61. package/template-deno-solid-ts/vite.config.mts +9 -0
  62. package/template-deno-svelte/_gitignore +24 -0
  63. package/template-deno-svelte/src/App.svelte +1 -1
  64. package/template-deno-svelte/vite.config.mjs +3 -3
  65. package/template-deno-svelte-ts/.vscode/extensions.json +3 -0
  66. package/template-deno-svelte-ts/README.md +30 -0
  67. package/template-deno-svelte-ts/_gitignore +24 -0
  68. package/template-deno-svelte-ts/deno.json +8 -0
  69. package/template-deno-svelte-ts/index.html +13 -0
  70. package/template-deno-svelte-ts/public/vite-deno.svg +36 -0
  71. package/template-deno-svelte-ts/public/vite.svg +1 -0
  72. package/template-deno-svelte-ts/src/App.svelte +46 -0
  73. package/template-deno-svelte-ts/src/app.css +81 -0
  74. package/template-deno-svelte-ts/src/assets/svelte.svg +1 -0
  75. package/template-deno-svelte-ts/src/lib/Counter.svelte +10 -0
  76. package/template-deno-svelte-ts/src/main.ts +8 -0
  77. package/template-deno-svelte-ts/src/vite-env.d.ts +2 -0
  78. package/template-deno-svelte-ts/svelte.config.js +5 -0
  79. package/template-deno-svelte-ts/vite.config.mts +9 -0
  80. package/template-deno-vanilla/_gitignore +24 -0
  81. package/template-deno-vanilla-ts/_gitignore +24 -0
  82. package/template-deno-vanilla-ts/deno.json +8 -0
  83. package/template-deno-vanilla-ts/index.html +13 -0
  84. package/template-deno-vanilla-ts/public/vite-deno.svg +36 -0
  85. package/template-deno-vanilla-ts/public/vite.svg +1 -0
  86. package/template-deno-vanilla-ts/src/counter.ts +9 -0
  87. package/template-deno-vanilla-ts/src/main.ts +24 -0
  88. package/template-deno-vanilla-ts/src/style.css +97 -0
  89. package/template-deno-vanilla-ts/src/typescript.svg +1 -0
  90. package/template-deno-vanilla-ts/src/vite-env.d.ts +1 -0
  91. package/template-deno-vue/_gitignore +25 -0
  92. package/template-deno-vue/vite.config.mjs +2 -2
  93. package/template-deno-vue-ts/README.md +41 -0
  94. package/template-deno-vue-ts/_gitignore +24 -0
  95. package/template-deno-vue-ts/deno.json +8 -0
  96. package/template-deno-vue-ts/index.html +13 -0
  97. package/template-deno-vue-ts/public/vite-deno.svg +36 -0
  98. package/template-deno-vue-ts/public/vite.svg +1 -0
  99. package/template-deno-vue-ts/src/App.vue +32 -0
  100. package/template-deno-vue-ts/src/assets/vue.svg +1 -0
  101. package/template-deno-vue-ts/src/components/HelloWorld.vue +38 -0
  102. package/template-deno-vue-ts/src/main.ts +5 -0
  103. package/template-deno-vue-ts/src/style.css +81 -0
  104. package/template-deno-vue-ts/src/vite-env.d.ts +7 -0
  105. package/template-deno-vue-ts/vite.config.mts +9 -0
  106. package/template-library/package.json +1 -1
  107. package/template-library-ts/package.json +2 -2
  108. package/template-ssr-preact/package.json +1 -1
  109. package/template-ssr-preact-ts/package.json +3 -3
  110. package/template-ssr-react/package.json +3 -3
  111. package/template-ssr-react-ts/package.json +4 -4
  112. package/template-ssr-solid/package.json +3 -3
  113. package/template-ssr-solid-ts/package.json +3 -3
  114. package/template-ssr-svelte/package.json +3 -3
  115. package/template-ssr-svelte/src/App.svelte +1 -1
  116. package/template-ssr-svelte-ts/package.json +5 -6
  117. package/template-ssr-svelte-ts/src/App.svelte +1 -1
  118. package/template-ssr-svelte-ts/svelte.config.js +2 -4
  119. package/template-ssr-transform/package.json +1 -1
  120. package/template-ssr-vanilla/package.json +1 -1
  121. package/template-ssr-vanilla-ts/package.json +3 -3
  122. package/template-ssr-vue/package.json +2 -2
  123. package/template-ssr-vue-ts/package.json +4 -4
package/README.md CHANGED
@@ -49,27 +49,37 @@ deno run -A npm:create-vite-extra --template deno-vue
49
49
 
50
50
  Currently supported template presets include:
51
51
 
52
- | Template | Try online |
53
- | ---------------- | ------------------------------------------------------------------------------------------------------------ |
54
- | `ssr-vanilla` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-vanilla) |
55
- | `ssr-vanilla-ts` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-vanilla-ts) |
56
- | `ssr-vue` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-vue) |
57
- | `ssr-vue-ts` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-vue-ts) |
58
- | `ssr-react` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-react) |
59
- | `ssr-react-ts` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-react-ts) |
60
- | `ssr-preact` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-preact) |
61
- | `ssr-preact-ts` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-preact-ts) |
62
- | `ssr-svelte` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-svelte) |
63
- | `ssr-svelte-ts` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-svelte-ts) |
64
- | `deno-vanilla` | |
65
- | `deno-vue` | |
66
- | `deno-react` | |
67
- | `deno-preact` | |
68
- | `deno-lit` | |
69
- | `deno-svelte` | |
70
- | `library` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-library) |
71
- | `library-ts` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-library-ts) |
72
- | `ssr-transform` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-transform) |
52
+ | Template | Try online |
53
+ | ------------------- | ------------------------------------------------------------------------------------------------------------ |
54
+ | `ssr-vanilla` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-vanilla) |
55
+ | `ssr-vanilla-ts` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-vanilla-ts) |
56
+ | `ssr-vue` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-vue) |
57
+ | `ssr-vue-ts` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-vue-ts) |
58
+ | `ssr-react` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-react) |
59
+ | `ssr-react-ts` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-react-ts) |
60
+ | `ssr-react-swc` | |
61
+ | `ssr-react-swc-ts` | |
62
+ | `ssr-preact` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-preact) |
63
+ | `ssr-preact-ts` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-preact-ts) |
64
+ | `ssr-svelte` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-svelte) |
65
+ | `ssr-svelte-ts` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-svelte-ts) |
66
+ | `deno-vanilla` | |
67
+ | `deno-vanilla-ts` | |
68
+ | `deno-vue` | |
69
+ | `deno-vue-ts` | |
70
+ | `deno-react` | |
71
+ | `deno-react-ts` | |
72
+ | `deno-react-swc` | |
73
+ | `deno-react-swc-ts` | |
74
+ | `deno-preact` | |
75
+ | `deno-preact-ts` | |
76
+ | `deno-lit` | |
77
+ | `deno-lit-ts` | |
78
+ | `deno-svelte` | |
79
+ | `deno-svelte-ts` | |
80
+ | `library` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-library) |
81
+ | `library-ts` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-library-ts) |
82
+ | `ssr-transform` | [StackBlitz](https://stackblitz.com/fork/github/bluwy/create-vite-extra/tree/master/template-ssr-transform) |
73
83
 
74
84
  You can use `.` for the project name to scaffold in the current directory.
75
85
 
package/index.js CHANGED
@@ -70,6 +70,16 @@ const FRAMEWORKS = [
70
70
  name: 'ssr-react-ts',
71
71
  display: 'TypeScript',
72
72
  color: blue
73
+ },
74
+ {
75
+ name: 'ssr-react-swc',
76
+ display: 'JavaScript + SWC',
77
+ color: yellow
78
+ },
79
+ {
80
+ name: 'ssr-react-swc-ts',
81
+ display: 'TypeScript + SWC',
82
+ color: blue
73
83
  }
74
84
  ]
75
85
  },
@@ -123,31 +133,125 @@ const FRAMEWORKS = [
123
133
  },
124
134
  {
125
135
  name: 'deno-vanilla',
126
- color: yellow
136
+ color: yellow,
137
+ variants: [
138
+ {
139
+ name: 'deno-vanilla',
140
+ display: 'JavaScript',
141
+ color: yellow
142
+ },
143
+ {
144
+ name: 'deno-vanilla-ts',
145
+ display: 'TypeScript',
146
+ color: blue
147
+ }
148
+ ]
127
149
  },
128
150
  {
129
151
  name: 'deno-vue',
130
- color: green
152
+ color: green,
153
+ variants: [
154
+ {
155
+ name: 'deno-vue',
156
+ display: 'JavaScript',
157
+ color: yellow
158
+ },
159
+ {
160
+ name: 'deno-vue-ts',
161
+ display: 'TypeScript',
162
+ color: blue
163
+ }
164
+ ]
131
165
  },
132
166
  {
133
167
  name: 'deno-react',
134
- color: cyan
168
+ color: cyan,
169
+ variants: [
170
+ {
171
+ name: 'deno-react',
172
+ display: 'JavaScript',
173
+ color: yellow
174
+ },
175
+ {
176
+ name: 'deno-react-ts',
177
+ display: 'TypeScript',
178
+ color: blue
179
+ },
180
+ {
181
+ name: 'deno-react-swc',
182
+ display: 'JavaScript + SWC',
183
+ color: yellow
184
+ },
185
+ {
186
+ name: 'deno-react-swc-ts',
187
+ display: 'TypeScript + SWC',
188
+ color: blue
189
+ }
190
+ ]
135
191
  },
136
192
  {
137
193
  name: 'deno-preact',
138
- color: magenta
194
+ color: magenta,
195
+ variants: [
196
+ {
197
+ name: 'deno-preact',
198
+ display: 'JavaScript',
199
+ color: yellow
200
+ },
201
+ {
202
+ name: 'deno-preact-ts',
203
+ display: 'TypeScript',
204
+ color: blue
205
+ }
206
+ ]
139
207
  },
140
208
  {
141
209
  name: 'deno-lit',
142
- color: lightRed
210
+ color: lightRed,
211
+ variants: [
212
+ {
213
+ name: 'deno-lit',
214
+ display: 'JavaScript',
215
+ color: yellow
216
+ },
217
+ {
218
+ name: 'deno-lit-ts',
219
+ display: 'TypeScript',
220
+ color: blue
221
+ }
222
+ ]
143
223
  },
144
224
  {
145
225
  name: 'deno-svelte',
146
- color: red
226
+ color: red,
227
+ variants: [
228
+ {
229
+ name: 'deno-svelte',
230
+ display: 'JavaScript',
231
+ color: yellow
232
+ },
233
+ {
234
+ name: 'deno-svelte-ts',
235
+ display: 'TypeScript',
236
+ color: blue
237
+ }
238
+ ]
147
239
  },
148
240
  {
149
241
  name: 'deno-solid',
150
- color: lightBlue
242
+ color: lightBlue,
243
+ variants: [
244
+ {
245
+ name: 'deno-solid',
246
+ display: 'JavaScript',
247
+ color: yellow
248
+ },
249
+ {
250
+ name: 'deno-solid-ts',
251
+ display: 'TypeScript',
252
+ color: blue
253
+ }
254
+ ]
151
255
  },
152
256
  {
153
257
  name: 'library',
@@ -183,7 +287,7 @@ async function init() {
183
287
  /** @type {string} */
184
288
  // @ts-ignore
185
289
  let targetDir = formatTargetDir(argv._[0])
186
- let template = argv.template || argv.t
290
+ const argTemplate = argv.template || argv.t
187
291
 
188
292
  const defaultTargetDir = 'vite-project'
189
293
  const getProjectName = () =>
@@ -232,19 +336,20 @@ async function init() {
232
336
  isValidPackageName(dir) || 'Invalid package.json name'
233
337
  },
234
338
  {
235
- type: template && TEMPLATES.includes(template) ? null : 'select',
339
+ type:
340
+ argTemplate && TEMPLATES.includes(argTemplate) ? null : 'select',
236
341
  name: 'framework',
237
342
  message:
238
- typeof template === 'string' && !TEMPLATES.includes(template)
343
+ typeof argTemplate === 'string' && !TEMPLATES.includes(argTemplate)
239
344
  ? reset(
240
- `"${template}" isn't a valid template. Please choose from below: `
345
+ `"${argTemplate}" isn't a valid template. Please choose from below: `
241
346
  )
242
347
  : reset('Select a template:'),
243
348
  initial: 0,
244
349
  choices: FRAMEWORKS.map((framework) => {
245
350
  const frameworkColor = framework.color
246
351
  return {
247
- title: frameworkColor(framework.name),
352
+ title: frameworkColor(framework.display || framework.name),
248
353
  value: framework
249
354
  }
250
355
  })
@@ -259,7 +364,7 @@ async function init() {
259
364
  framework.variants.map((variant) => {
260
365
  const variantColor = variant.color
261
366
  return {
262
- title: variantColor(variant.name),
367
+ title: variantColor(variant.display || variant.name),
263
368
  value: variant.name
264
369
  }
265
370
  })
@@ -288,7 +393,12 @@ async function init() {
288
393
  }
289
394
 
290
395
  // determine template
291
- template = variant || framework?.name || template
396
+ let template = variant || framework?.name || argTemplate
397
+ let isReactSwc = false
398
+ if (template.includes('-swc')) {
399
+ isReactSwc = true
400
+ template = template.replace('-swc', '')
401
+ }
292
402
 
293
403
  console.log(`\nScaffolding project in ${root}...`)
294
404
 
@@ -316,6 +426,10 @@ async function init() {
316
426
 
317
427
  const isDeno = template.startsWith('deno-')
318
428
  if (isDeno) {
429
+ if (isReactSwc) {
430
+ setupReactSwc(root, { isTs: template.endsWith('-ts'), isDeno: true })
431
+ }
432
+
319
433
  console.log(`\nDone. Now run:\n`)
320
434
  if (root !== cwd) {
321
435
  console.log(` cd ${path.relative(cwd, root)}`)
@@ -331,6 +445,10 @@ async function init() {
331
445
 
332
446
  write('package.json', JSON.stringify(pkg, null, 2))
333
447
 
448
+ if (isReactSwc) {
449
+ setupReactSwc(root, { isTs: template.endsWith('-ts'), isDeno: false })
450
+ }
451
+
334
452
  const pkgInfo = pkgFromUserAgent(process.env.npm_config_user_agent)
335
453
  const pkgManager = pkgInfo ? pkgInfo.name : 'npm'
336
454
 
@@ -436,6 +554,41 @@ function pkgFromUserAgent(userAgent) {
436
554
  }
437
555
  }
438
556
 
557
+ /**
558
+ * @param {string} root
559
+ * @param {{ isTs: boolean, isDeno: boolean }} options
560
+ */
561
+ function setupReactSwc(root, { isTs, isDeno }) {
562
+ if (isDeno) {
563
+ editFile(path.resolve(root, 'deno.json'), (content) => {
564
+ return content.replace(/deno run -A/g, 'deno run -A --unstable')
565
+ })
566
+ } else {
567
+ editFile(path.resolve(root, 'package.json'), (content) => {
568
+ return content.replace(
569
+ /"@vitejs\/plugin-react": ".+?"/,
570
+ `"@vitejs/plugin-react-swc": "^3.0.0"`
571
+ )
572
+ })
573
+ }
574
+ editFile(
575
+ path.resolve(root, `vite.config.${isDeno ? 'm' : ''}${isTs ? 'ts' : 'js'}`),
576
+ (content) => {
577
+ return content.replace('@vitejs/plugin-react', '@vitejs/plugin-react-swc')
578
+ }
579
+ )
580
+ }
581
+
582
+ /**
583
+ *
584
+ * @param {string} file
585
+ * @param {(content: string) => string} callback
586
+ */
587
+ function editFile(file, callback) {
588
+ const content = fs.readFileSync(file, 'utf-8')
589
+ fs.writeFileSync(file, callback(content), 'utf-8')
590
+ }
591
+
439
592
  init().catch((e) => {
440
593
  console.error(e)
441
594
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vite-extra",
3
- "version": "0.1.9",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Bjorn Lu",
@@ -0,0 +1,24 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?
@@ -1,14 +1,13 @@
1
- import { defineConfig } from 'npm:vite@^3.2.3'
1
+ import { defineConfig } from 'npm:vite@^4.0.0'
2
2
 
3
- import 'npm:lit@^2.4.1'
3
+ import 'npm:lit@^2.5.0'
4
4
 
5
5
  // https://vitejs.dev/config/
6
6
  export default defineConfig({
7
7
  build: {
8
8
  lib: {
9
9
  entry: 'src/my-element.js',
10
- formats: ['es'],
11
- fileName: 'app'
10
+ formats: ['es']
12
11
  },
13
12
  rollupOptions: {
14
13
  external: /^lit/
@@ -0,0 +1,30 @@
1
+ # Vite + Deno + Lit + TypeScript
2
+
3
+ ## Running
4
+
5
+ You need to have Deno v1.28.0 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,24 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?
@@ -0,0 +1,6 @@
1
+ {
2
+ "tasks": {
3
+ "dev": "deno run -A --node-modules-dir npm:vite",
4
+ "build": "deno run -A --node-modules-dir npm:vite build"
5
+ }
6
+ }
@@ -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.ts"></script>
10
+ </head>
11
+ <body>
12
+ <my-element>
13
+ <h1>Vite + Lit</h1>
14
+ </my-element>
15
+ </body>
16
+ </html>
@@ -0,0 +1,36 @@
1
+ <svg width="248" height="275" viewBox="0 0 248 275" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_553_1862)">
3
+ <ellipse cx="133.981" cy="219.676" rx="73.9807" ry="14.6763" fill="#74825F" fill-opacity="0.51"/>
4
+ <path d="M136.505 51.7512C153.877 66.3061 166.457 128.128 173.046 171.857C188.321 192.524 218.273 184.138 219.471 183.239C220.669 182.341 233.548 171.857 229.954 190.727C226.36 209.597 197.307 215.287 173.046 210.495C173.046 214.688 158.669 233.258 139.8 235.355C124.704 237.032 113.941 226.869 110.447 221.577L99.3649 216.186C96.7691 217.584 81.6934 221.817 64.9205 221.577C43.9543 221.278 44.8528 197.915 51.1427 186.833C56.1746 177.968 71.41 176.949 78.3987 177.548L84.3891 163.471C82.3923 163.671 69.9524 162.453 67.3166 161.973C64.0219 161.374 55.6307 149.898 59.2296 134.118C63.1234 117.046 95.7707 113.751 99.3649 112.254C102.959 110.756 104.457 96.6787 104.157 83.5C88.5823 81.7029 72.5581 73.9155 76.6016 55.0459C81.9929 29.8864 114.341 33.1812 136.505 51.7512Z" fill="#B1F491" stroke="black" stroke-width="3.5942" stroke-linecap="round"/>
5
+ <path d="M102.66 83.5C106.254 83.8994 114.041 84.159 116.437 82.0024" stroke="#3E7B28" stroke-opacity="0.55" stroke-width="3.5942" stroke-linecap="round"/>
6
+ <path d="M90.3794 206.601C92.7756 213.191 100.863 216.785 100.863 216.785" stroke="#3E7B28" stroke-opacity="0.55" stroke-width="3.5942" stroke-linecap="round"/>
7
+ <path d="M171.249 196.418C172.148 199.114 173.346 210.495 171.249 214.389" stroke="#3E7B28" stroke-opacity="0.55" stroke-width="3.5942" stroke-linecap="round"/>
8
+ <circle cx="112.544" cy="54.2488" r="2.99517" fill="black"/>
9
+ <path d="M63.1234 128.128C67.9157 130.924 77.62 138.312 78.0992 145.5C78.6983 154.486 73.307 160.476 69.1137 161.973" stroke="#3E7B28" stroke-opacity="0.55" stroke-width="3.5942" stroke-linecap="round"/>
10
+ <path d="M54.1379 182.64C58.7305 183.838 66.4181 189.23 67.9157 197.616C69.4132 206.002 71.5099 217.684 62.8239 221.577" stroke="#3E7B28" stroke-opacity="0.55" stroke-width="3.5942" stroke-linecap="round"/>
11
+ <path d="M68.5147 137.114L74.505 131.722" stroke="#3E7B28" stroke-opacity="0.55" stroke-width="3.5942" stroke-linecap="round"/>
12
+ <path d="M73.0074 149.693L81.6934 151.79" stroke="#3E7B28" stroke-opacity="0.55" stroke-width="3.5942" stroke-linecap="round"/>
13
+ <path d="M61.0268 191.626L67.6162 188.031" stroke="#3E7B28" stroke-opacity="0.55" stroke-width="3.5942" stroke-linecap="round"/>
14
+ <path d="M65.819 208.099L73.6065 210.196" stroke="#3E7B28" stroke-opacity="0.55" stroke-width="3.5942" stroke-linecap="round"/>
15
+ <path d="M30.9264 186.393L26.0084 169.639C25.7495 168.757 26.7174 168.022 27.4972 168.509L105.553 217.204C107.381 218.344 107.446 220.984 105.676 222.213L98.9017 226.917C94.8436 229.735 89.5878 230.226 85.1343 228.087C64.6655 218.258 52.0858 209.624 34.4753 192.341C32.8025 190.699 31.5866 188.642 30.9264 186.393Z" fill="#4DC3FF" stroke="black" stroke-width="4"/>
16
+ <path d="M41.8791 160.074L46.7262 148.312C47.4243 146.618 49.8432 146.677 50.459 148.402L55.3497 162.106C55.872 163.57 54.5987 165.044 53.0748 164.74L43.337 162.797C42.1019 162.551 41.3992 161.238 41.8791 160.074Z" fill="#FFA901" stroke="black" stroke-width="4"/>
17
+ <path d="M71.8785 149.588L101.01 128.223C105.454 124.964 111.741 127.892 112.05 133.394C113.793 164.454 113.06 185.535 109.769 215.636C109.227 220.59 103.792 223.354 99.4667 220.878C71.8486 205.063 53.3581 192.516 27.512 172.516C22.8968 168.945 24.4798 161.641 30.1507 160.265L69.3892 150.746C70.2872 150.528 71.1333 150.134 71.8785 149.588Z" fill="#BD34FE" stroke="black" stroke-width="4"/>
18
+ <path d="M49.0264 145.468C58.7514 138.974 75.386 127.953 81.8842 123.946C83.0547 123.224 84.4689 123.961 84.6314 125.326L86.5911 141.788C86.752 143.139 88.1864 143.939 89.4205 143.365L95.4192 140.575C96.8754 139.898 98.4956 141.126 98.2363 142.711L90.6765 188.924C90.3789 190.743 87.9869 191.225 87.008 189.663L80.4098 179.132C79.7539 178.085 78.3152 177.877 77.3899 178.696L75.0448 180.77C74.0312 181.667 72.4383 181.319 71.8907 180.081L67.5098 170.18C66.9622 168.943 65.3693 168.595 64.3557 169.492L62.2372 171.366C61.2396 172.248 59.6743 171.927 59.1044 170.724L48.3367 147.981C47.9126 147.085 48.202 146.018 49.0264 145.468Z" fill="#FFD32B" stroke="black" stroke-width="4"/>
19
+ <circle cx="92.7756" cy="48.2585" r="2.99517" fill="black"/>
20
+ <path d="M104.88 161.075C100.088 151.97 109.473 142.505 114.764 138.911L151.904 151.49C152.004 156.582 150.047 168.143 141.421 173.655C130.638 180.543 110.87 172.457 104.88 161.075Z" fill="#B1F491"/>
21
+ <path d="M111.346 222.775C101.521 208.878 115.439 197.017 123.626 192.824C129.703 192.1 142.516 193.468 145.152 204.73C148.446 218.807 130.554 237.227 111.346 222.775Z" fill="#B1F491"/>
22
+ <path d="M123.626 192.824C112.285 195.592 101.179 211.429 115.799 227.493" stroke="black" stroke-width="3.5942" stroke-linecap="round"/>
23
+ <path d="M114.764 138.911C109.473 142.505 100.088 151.97 104.88 161.075C110.87 172.457 130.638 180.543 141.421 173.655C150.047 168.143 152.004 156.582 151.904 151.49" stroke="black" stroke-width="3.5942" stroke-linecap="round"/>
24
+ <path d="M104.457 153.887C108.35 151.99 118.354 149.334 127.22 153.887C138.302 159.577 143.993 167.964 144.592 170.66" stroke="#3E7B28" stroke-opacity="0.55" stroke-width="3.5942" stroke-linecap="round"/>
25
+ <path d="M115.539 155.684L118.235 147.297" stroke="#3E7B28" stroke-opacity="0.55" stroke-width="3.5942" stroke-linecap="round"/>
26
+ <path d="M136.505 165.268L141.896 159.278" stroke="#3E7B28" stroke-opacity="0.55" stroke-width="3.5942" stroke-linecap="round"/>
27
+ <path d="M115.539 199.114C130.814 197.317 138.003 205.104 139.5 214.089C140.998 223.075 138.602 235.056 132.312 235.655" stroke="#3E7B28" stroke-opacity="0.55" stroke-width="3.5942" stroke-linecap="round"/>
28
+ <path d="M129.317 205.403L134.109 198.814" stroke="#3E7B28" stroke-opacity="0.55" stroke-width="3.5942" stroke-linecap="round"/>
29
+ <path d="M135.906 217.384L144.592 213.79" stroke="#3E7B28" stroke-opacity="0.55" stroke-width="3.5942" stroke-linecap="round"/>
30
+ </g>
31
+ <defs>
32
+ <clipPath id="clip0_553_1862">
33
+ <rect width="248" height="274.957" fill="white"/>
34
+ </clipPath>
35
+ </defs>
36
+ </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="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,40 @@
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
+ @media (prefers-color-scheme: light) {
36
+ :root {
37
+ color: #213547;
38
+ background-color: #ffffff;
39
+ }
40
+ }