@colabcommerce/elements 0.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.
package/package.json ADDED
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "@colabcommerce/elements",
3
+ "version": "0.0.1",
4
+ "license": "UNLICENSED",
5
+ "type": "module",
6
+ "exports": {
7
+ "./Retailer": "./dist/Retailer.js",
8
+ "./StoreLocator": "./dist/StoreLocator.js",
9
+ "./ProductForm": "./dist/ProductForm.js",
10
+ "./CartForm": "./dist/CartForm.js",
11
+ "./dist/*.css": "./dist/*.css"
12
+ },
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "sideEffects": [
17
+ "*.css"
18
+ ],
19
+ "scripts": {
20
+ "build": "vite build",
21
+ "build:dev": "vite build --mode development",
22
+ "dev:storeLocator": "vite ./playground/StoreLocator -c vite.config.js",
23
+ "dev:retailer": "vite ./playground/Retailer -c vite.config.js",
24
+ "dev:cartForm": "vite ./playground/CartForm -c vite.config.js",
25
+ "dev:productForm": "vite ./playground/ProductForm -c vite.config.js",
26
+ "test": "vitest",
27
+ "e2e": "cypress open"
28
+ },
29
+ "peerDependencies": {
30
+ "react": ">=18",
31
+ "react-dom": ">=18"
32
+ },
33
+ "devDependencies": {
34
+ "@csstools/postcss-sass": "^5.1.1",
35
+ "@vitejs/plugin-react": "^4",
36
+ "autoprefixer": "^10",
37
+ "cypress": "^15.4.0",
38
+ "cypress-vite": "^1.8.0",
39
+ "dotenv": "^17.2.2",
40
+ "fast-glob": "^3.3.3",
41
+ "postcss": "^8",
42
+ "react": "^18.0.0",
43
+ "react-dom": "^18.0.0",
44
+ "rollup-plugin-postcss": "^4",
45
+ "sass": "^1",
46
+ "typescript": "^5",
47
+ "vite": "^5",
48
+ "vite-plugin-dts": "^4",
49
+ "vite-plugin-i18next-loader": "^3.1.2",
50
+ "vitest": "^3.2.4"
51
+ },
52
+ "dependencies": {
53
+ "@date-fns/tz": "^1.4.1",
54
+ "@tailwindcss/vite": "^4.1.14",
55
+ "@vis.gl/react-google-maps": "^1.5.5",
56
+ "bootstrap": "^5.3.8",
57
+ "formik": "^2.4.6",
58
+ "i18next": "^25.4.2",
59
+ "i18next-fetch-backend": "^6.0.0",
60
+ "i18next-http-backend": "^3.0.2",
61
+ "lucide-react": "^0.542.0",
62
+ "qs": "^6.14.0",
63
+ "react-bootstrap": "^2.10.10",
64
+ "react-geocode": "^2.0.1",
65
+ "react-geolocated": "^4.3.0",
66
+ "react-i18next": "^15.7.3",
67
+ "react-icons": "^5.5.0",
68
+ "react-loading-skeleton": "^3.5.0",
69
+ "react-slick": "^0.31.0",
70
+ "react-toggle": "^4.1.3",
71
+ "slick-carousel": "^1.8.1",
72
+ "swiper": "^11.2.10",
73
+ "swr": "^2.3.6",
74
+ "tailwindcss": "^4.1.14",
75
+ "vite-plugin-sass": "^0.1.0",
76
+ "yup": "^1.7.0"
77
+ },
78
+ "description": "",
79
+ "main": "vite.config.js",
80
+ "author": "colabcommerce"
81
+ }
package/vite.config.js ADDED
@@ -0,0 +1,57 @@
1
+ import { defineConfig, loadEnv } from "vite";
2
+ import react from "@vitejs/plugin-react";
3
+ import tailwindcss from "@tailwindcss/vite"
4
+ import path from "path";
5
+
6
+ export default defineConfig(({ command, mode }) => {
7
+
8
+ const entries = {
9
+ 'Retailer': 'src/components/Retailer/index.jsx',
10
+ 'StoreLocator': 'src/components/StoreLocator/index.jsx',
11
+ 'ProductForm': 'src/components/ProductForm/index.jsx',
12
+ 'CartForm': 'src/components/CartForm/index.jsx'
13
+ }
14
+
15
+ const config = {
16
+ plugins: [
17
+ react(),
18
+ tailwindcss()
19
+ ],
20
+ resolve: {
21
+ alias: {
22
+ "@": path.resolve(__dirname, "src")
23
+ }
24
+ },
25
+ build: {
26
+ lib: {
27
+ entry: entries,
28
+ name: "PalliserElements",
29
+ formats: ["es"],
30
+ //fileName: (format) => `palliser-elements.${format}.js`,
31
+ },
32
+ rollupOptions: {
33
+ external: ["react", "react-dom", "react/jsx-runtime"],
34
+ output: {
35
+ globals: {
36
+ react: "React",
37
+ "react-dom": "ReactDOM"
38
+ }
39
+ },
40
+ },
41
+ cssCodeSplit: false
42
+ },
43
+ css: {
44
+ // Also enable modules in dev (Vite dev server) with same pattern
45
+ modules: {
46
+ generateScopedName: command === "serve" ? "[name]__[local]__[hash:base64:5]" : "[hash:base64:5]"
47
+ },
48
+ preprocessorOptions: {
49
+ scss: {
50
+ silenceDeprecations: ['legacy-js-api', 'color-functions', 'global-builtin', 'import'],
51
+ } // enables .module.scss too
52
+ }
53
+ }
54
+ }
55
+
56
+ return config;
57
+ });