fulldev-ui 0.5.0-beta.10 → 0.5.0-beta.12

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/.env.example ADDED
@@ -0,0 +1,3 @@
1
+ SITE_URL=https://localhost:4321
2
+ STRIPE_SECRET_KEY=
3
+ STRIPE_RESTRICTED_KEY=
package/astro.config.ts CHANGED
@@ -1,5 +1,3 @@
1
- import mdx from '@astrojs/mdx'
2
- import sitemap from '@astrojs/sitemap'
3
1
  // @ts-ignore
4
2
  import liveCode from 'astro-live-code'
5
3
  import { defineConfig } from 'astro/config'
@@ -7,17 +5,10 @@ import integration from 'fulldev-ui/integration'
7
5
 
8
6
  // https://astro.build/config
9
7
  export default defineConfig({
10
- site: 'https://ui.full.dev',
11
8
  devToolbar: {
12
9
  enabled: false,
13
10
  },
14
- experimental: {
15
- contentIntellisense: false,
16
- contentLayer: true,
17
- },
18
11
  integrations: [
19
- sitemap(),
20
- mdx(),
21
12
  liveCode({
22
13
  layout: '/src/components/experimental/Window.astro',
23
14
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fulldev-ui",
3
- "version": "0.5.0-beta.10",
3
+ "version": "0.5.0-beta.12",
4
4
  "description": "A component library built for Astro",
5
5
  "homepage": "https://ui.full.dev",
6
6
  "bugs": "https://github.com/fulldotdev/ui/issues",
@@ -49,6 +49,7 @@
49
49
  "astro": "^4.16.6",
50
50
  "astro-favicons": "^2.0.2",
51
51
  "astro-live-code": "^0.0.3",
52
+ "astro-robots-txt": "^1.0.0",
52
53
  "astro-seo": "^0.8.4",
53
54
  "bezier-easing": "^2.1.0",
54
55
  "colorjs.io": "^0.5.2",
@@ -67,6 +68,7 @@
67
68
  "typescript": "^5.6.3",
68
69
  "unocss": "^0.63.4",
69
70
  "url": "^0.11.4",
71
+ "vite": "^5.4.10",
70
72
  "vite-plugin-virtual": "^0.3.0",
71
73
  "zod": "^3.23.8",
72
74
  "zod-to-ts": "^1.2.0"
package/pnpm-lock.yaml CHANGED
@@ -41,6 +41,9 @@ dependencies:
41
41
  astro-live-code:
42
42
  specifier: ^0.0.3
43
43
  version: 0.0.3
44
+ astro-robots-txt:
45
+ specifier: ^1.0.0
46
+ version: 1.0.0
44
47
  astro-seo:
45
48
  specifier: ^0.8.4
46
49
  version: 0.8.4(prettier-plugin-astro@0.14.1)(prettier@3.3.3)(typescript@5.6.3)
@@ -91,13 +94,16 @@ dependencies:
91
94
  version: 5.6.3
92
95
  unocss:
93
96
  specifier: ^0.63.4
94
- version: 0.63.4(postcss@8.4.45)(vite@5.4.9)
97
+ version: 0.63.4(postcss@8.4.45)(vite@5.4.10)
95
98
  url:
96
99
  specifier: ^0.11.4
97
100
  version: 0.11.4
101
+ vite:
102
+ specifier: ^5.4.10
103
+ version: 5.4.10(sass@1.80.2)
98
104
  vite-plugin-virtual:
99
105
  specifier: ^0.3.0
100
- version: 0.3.0(vite@5.4.9)
106
+ version: 0.3.0(vite@5.4.10)
101
107
  zod:
102
108
  specifier: ^3.23.8
103
109
  version: 3.23.8
@@ -1796,7 +1802,7 @@ packages:
1796
1802
  resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
1797
1803
  dev: false
1798
1804
 
1799
- /@unocss/astro@0.63.4(vite@5.4.9):
1805
+ /@unocss/astro@0.63.4(vite@5.4.10):
1800
1806
  resolution: {integrity: sha512-qu1uMDUT8lXU3mm5EjZpnizvjSYtfY0TTDivR5QNm1i3Xd+ErHfdfOpXdJ2mYvxv+X7C570//KUugkTI3Mb3kQ==}
1801
1807
  peerDependencies:
1802
1808
  vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0
@@ -1806,8 +1812,8 @@ packages:
1806
1812
  dependencies:
1807
1813
  '@unocss/core': 0.63.4
1808
1814
  '@unocss/reset': 0.63.4
1809
- '@unocss/vite': 0.63.4(vite@5.4.9)
1810
- vite: 5.4.9(sass@1.80.2)
1815
+ '@unocss/vite': 0.63.4(vite@5.4.10)
1816
+ vite: 5.4.10(sass@1.80.2)
1811
1817
  transitivePeerDependencies:
1812
1818
  - rollup
1813
1819
  - supports-color
@@ -1980,7 +1986,7 @@ packages:
1980
1986
  '@unocss/core': 0.63.4
1981
1987
  dev: false
1982
1988
 
1983
- /@unocss/vite@0.63.4(vite@5.4.9):
1989
+ /@unocss/vite@0.63.4(vite@5.4.10):
1984
1990
  resolution: {integrity: sha512-YK0L177GD8Kx+JtfiCJy4YyBYckAXo4ogC8LZ+pYVNXDMN+F+XItpGI/ofLRaGIaewNg+MJgGY+CQZceABEAfg==}
1985
1991
  peerDependencies:
1986
1992
  vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0
@@ -1993,7 +1999,7 @@ packages:
1993
1999
  chokidar: 3.6.0
1994
2000
  magic-string: 0.30.11
1995
2001
  tinyglobby: 0.2.9
1996
- vite: 5.4.9(sass@1.80.2)
2002
+ vite: 5.4.10(sass@1.80.2)
1997
2003
  transitivePeerDependencies:
1998
2004
  - rollup
1999
2005
  - supports-color
@@ -2228,6 +2234,13 @@ packages:
2228
2234
  unist-util-visit-parents: 6.0.1
2229
2235
  dev: false
2230
2236
 
2237
+ /astro-robots-txt@1.0.0:
2238
+ resolution: {integrity: sha512-6JQSLid4gMhoWjOm85UHLkgrw0+hHIjnJVIUqxjU2D6feKlVyYukMNYjH44ZDZBK1P8hNxd33PgWlHzCASvedA==}
2239
+ dependencies:
2240
+ valid-filename: 4.0.0
2241
+ zod: 3.23.8
2242
+ dev: false
2243
+
2231
2244
  /astro-seo@0.8.4(prettier-plugin-astro@0.14.1)(prettier@3.3.3)(typescript@5.6.3):
2232
2245
  resolution: {integrity: sha512-Ou1vzQSXAxa0K8rtNtXNvSpYqOGEgMhh0immMxJeXmbVZac3UKCNWAoXWyOQDFYsZvBugCRSg0N1phBqPMVgCw==}
2233
2246
  dependencies:
@@ -2297,8 +2310,8 @@ packages:
2297
2310
  tsconfck: 3.1.4(typescript@5.6.3)
2298
2311
  unist-util-visit: 5.0.0
2299
2312
  vfile: 6.0.3
2300
- vite: 5.4.9(sass@1.80.2)
2301
- vitefu: 1.0.3(vite@5.4.9)
2313
+ vite: 5.4.10(sass@1.80.2)
2314
+ vitefu: 1.0.3(vite@5.4.10)
2302
2315
  which-pm: 3.0.0
2303
2316
  xxhash-wasm: 1.0.2
2304
2317
  yargs-parser: 21.1.1
@@ -3055,6 +3068,11 @@ packages:
3055
3068
  picomatch: 4.0.2
3056
3069
  dev: false
3057
3070
 
3071
+ /filename-reserved-regex@3.0.0:
3072
+ resolution: {integrity: sha512-hn4cQfU6GOT/7cFHXBqeBg2TbrMBgdD0kcjLhvSQYYwm3s4B6cjvBfb7nBALJLAXqmU5xajSa7X2NnUud/VCdw==}
3073
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
3074
+ dev: false
3075
+
3058
3076
  /fill-range@7.1.1:
3059
3077
  resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
3060
3078
  engines: {node: '>=8'}
@@ -5824,7 +5842,7 @@ packages:
5824
5842
  unist-util-visit-parents: 6.0.1
5825
5843
  dev: false
5826
5844
 
5827
- /unocss@0.63.4(postcss@8.4.45)(vite@5.4.9):
5845
+ /unocss@0.63.4(postcss@8.4.45)(vite@5.4.10):
5828
5846
  resolution: {integrity: sha512-MQ/ktuJ2MoXBsd117DEONFubJRQN6Og4mQJLbT+0nna2aTW4jYJESJ479mJYWq/ajonxEaM+zrf8M92VIWxzEw==}
5829
5847
  engines: {node: '>=14'}
5830
5848
  peerDependencies:
@@ -5836,7 +5854,7 @@ packages:
5836
5854
  vite:
5837
5855
  optional: true
5838
5856
  dependencies:
5839
- '@unocss/astro': 0.63.4(vite@5.4.9)
5857
+ '@unocss/astro': 0.63.4(vite@5.4.10)
5840
5858
  '@unocss/cli': 0.63.4
5841
5859
  '@unocss/core': 0.63.4
5842
5860
  '@unocss/postcss': 0.63.4(postcss@8.4.45)
@@ -5852,8 +5870,8 @@ packages:
5852
5870
  '@unocss/transformer-compile-class': 0.63.4
5853
5871
  '@unocss/transformer-directives': 0.63.4
5854
5872
  '@unocss/transformer-variant-group': 0.63.4
5855
- '@unocss/vite': 0.63.4(vite@5.4.9)
5856
- vite: 5.4.9(sass@1.80.2)
5873
+ '@unocss/vite': 0.63.4(vite@5.4.10)
5874
+ vite: 5.4.10(sass@1.80.2)
5857
5875
  transitivePeerDependencies:
5858
5876
  - postcss
5859
5877
  - rollup
@@ -5883,6 +5901,13 @@ packages:
5883
5901
  resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
5884
5902
  dev: false
5885
5903
 
5904
+ /valid-filename@4.0.0:
5905
+ resolution: {integrity: sha512-VEYTpTVPMgO799f2wI7zWf0x2C54bPX6NAfbZ2Z8kZn76p+3rEYCTYVYzMUcVSMvakxMQTriBf24s3+WeXJtEg==}
5906
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
5907
+ dependencies:
5908
+ filename-reserved-regex: 3.0.0
5909
+ dev: false
5910
+
5886
5911
  /vfile-location@5.0.3:
5887
5912
  resolution: {integrity: sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==}
5888
5913
  dependencies:
@@ -5904,16 +5929,16 @@ packages:
5904
5929
  vfile-message: 4.0.2
5905
5930
  dev: false
5906
5931
 
5907
- /vite-plugin-virtual@0.3.0(vite@5.4.9):
5932
+ /vite-plugin-virtual@0.3.0(vite@5.4.10):
5908
5933
  resolution: {integrity: sha512-TOtrWw6jKrJNXfxhGRUiQzfAP1gRkYkVzMkJNjHUJ8idLuxf8eeeDKZKZHhdeYfaCc/87rv+KvWE2iCy1QInWA==}
5909
5934
  peerDependencies:
5910
5935
  vite: ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0
5911
5936
  dependencies:
5912
- vite: 5.4.9(sass@1.80.2)
5937
+ vite: 5.4.10(sass@1.80.2)
5913
5938
  dev: false
5914
5939
 
5915
- /vite@5.4.9(sass@1.80.2):
5916
- resolution: {integrity: sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg==}
5940
+ /vite@5.4.10(sass@1.80.2):
5941
+ resolution: {integrity: sha512-1hvaPshuPUtxeQ0hsVH3Mud0ZanOLwVTneA1EgbAM5LhaZEqyPWGRQ7BtaMvUrTDeEaC8pxtj6a6jku3x4z6SQ==}
5917
5942
  engines: {node: ^18.0.0 || >=20.0.0}
5918
5943
  hasBin: true
5919
5944
  peerDependencies:
@@ -5951,7 +5976,7 @@ packages:
5951
5976
  fsevents: 2.3.3
5952
5977
  dev: false
5953
5978
 
5954
- /vitefu@1.0.3(vite@5.4.9):
5979
+ /vitefu@1.0.3(vite@5.4.10):
5955
5980
  resolution: {integrity: sha512-iKKfOMBHob2WxEJbqbJjHAkmYgvFDPhuqrO82om83S8RLk+17FtyMBfcyeH8GqD0ihShtkMW/zzJgiA51hCNCQ==}
5956
5981
  peerDependencies:
5957
5982
  vite: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0-beta.0
@@ -5959,7 +5984,7 @@ packages:
5959
5984
  vite:
5960
5985
  optional: true
5961
5986
  dependencies:
5962
- vite: 5.4.9(sass@1.80.2)
5987
+ vite: 5.4.10(sass@1.80.2)
5963
5988
  dev: false
5964
5989
 
5965
5990
  /volar-service-css@0.0.61(@volar/language-service@2.4.4):
@@ -30,9 +30,9 @@ const {
30
30
 
31
31
  const slug = Astro.url.pathname.replace(/^\/|\/$/g, '') || 'index'
32
32
  const src = `/src/images/${images?.[0].id}`
33
- const gotImage = await getImage({ src, width: 200, height: 200 })
34
-
35
- console.log({ hoi: gotImage.src })
33
+ const allImages = import.meta.glob<{ default: ImageMetadata }>('/src/images/*')
34
+ const foundImage = allImages[src]
35
+ const gotImage = await getImage({ src: foundImage ? foundImage() : src })
36
36
  ---
37
37
 
38
38
  <Section
@@ -41,10 +41,11 @@ const { title, slug, image, price, variants, ...rest } = Astro.props
41
41
  name="url"
42
42
  value={Astro.site ? Astro.site.href + slug : undefined}
43
43
  />
44
+
44
45
  <Input
45
46
  type="hidden"
46
47
  name="image"
47
- value={Astro.url.origin ? Astro.url.origin + image : undefined}
48
+ value={image}
48
49
  />
49
50
  {
50
51
  Object.entries(variants ?? {}).map(([key, options]) => (
@@ -66,8 +66,6 @@ const { ...rest } = Astro.props
66
66
  import { formatPrice } from 'fulldev-ui/utils/cart'
67
67
  import Stripe from 'stripe'
68
68
 
69
- const stripe = new Stripe(import.meta.env.PUBLIC_STRIPE_CHECKOUT_KEY)
70
-
71
69
  function setPrice(items: any) {
72
70
  const price = document.querySelector('.cart-summary .price')
73
71
  if (price)
@@ -80,6 +78,8 @@ const { ...rest } = Astro.props
80
78
  }
81
79
 
82
80
  document.addEventListener('astro:page-load', () => {
81
+ const stripe = new Stripe(import.meta.env.STRIPE_RESTRICTED_KEY)
82
+ if (stripe) return
83
83
  setPrice($cart.get())
84
84
 
85
85
  $cart.subscribe((items: any) => {
@@ -128,7 +128,7 @@ const { ...rest } = Astro.props
128
128
  currency: 'eur',
129
129
  product_data: {
130
130
  name: item.name,
131
- images: [window],
131
+ images: [Astro.site ? Astro.site.href + item.image : undefined],
132
132
  },
133
133
  unit_amount: Math.round(item.price * 100),
134
134
  },
@@ -1,8 +1,13 @@
1
+ import mdx from '@astrojs/mdx'
2
+ import sitemap from '@astrojs/sitemap'
1
3
  import viteYaml from '@rollup/plugin-yaml'
2
4
  import type { AstroIntegration } from 'astro'
3
5
  import favicons from 'astro-favicons'
6
+ import robotsTxt from 'astro-robots-txt'
7
+ import { envField } from 'astro/config'
4
8
  import type { CollectionEntry } from 'astro:content'
5
9
  import merge from 'deepmerge'
10
+ import { loadEnv } from 'vite'
6
11
  import virtual from 'vite-plugin-virtual'
7
12
  import { generateRadixColors } from './generate-colors'
8
13
 
@@ -35,7 +40,6 @@ const defaultConfig: Config = {
35
40
  brand: '#000',
36
41
  },
37
42
  },
38
- // generateImageEntries: false,
39
43
  }
40
44
 
41
45
  export default function fulldevIntegration(
@@ -53,12 +57,39 @@ export default function fulldevIntegration(
53
57
  injectRoute,
54
58
  }) => {
55
59
  // ----------------------
56
- // Inject favicon integration
60
+ // Update config
57
61
  // ----------------------
58
62
  config.favicon &&
59
63
  config.company &&
60
64
  updateConfig({
65
+ experimental: {
66
+ contentLayer: true,
67
+ env: {
68
+ schema: {
69
+ SITE_URL: envField.string({
70
+ context: 'client',
71
+ access: 'public',
72
+ }),
73
+ STRIPE_RESTRICTED_KEY: envField.string({
74
+ context: 'client',
75
+ access: 'public',
76
+ optional: true,
77
+ }),
78
+ STRIPE_SECRET_KEY: envField.string({
79
+ context: 'server',
80
+ access: 'secret',
81
+ optional: true,
82
+ }),
83
+ },
84
+ validateSecrets: true,
85
+ },
86
+ },
87
+ site: loadEnv(process.env.NODE_ENV as any, process.cwd(), '')
88
+ .SITE_URL,
61
89
  integrations: [
90
+ sitemap(),
91
+ mdx(),
92
+ robotsTxt(),
62
93
  favicons({
63
94
  path: 'favicon',
64
95
  masterPicture: config.favicon,
package/src/utils/cart.ts CHANGED
@@ -1,7 +1,3 @@
1
- // import Stripe from 'stripe'
2
-
3
- // const stripe = new Stripe(import.meta.env.STRIPE_SECRET_KEY)
4
-
5
1
  const slugify = (input: string): string => {
6
2
  return input
7
3
  .toLowerCase()