uniweb 0.1.3 → 0.1.4

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +31 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uniweb",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "CLI for the Uniweb Component Web Platform",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -300,16 +300,46 @@ async function createSite(projectDir, projectName, isWorkspace = false) {
300
300
  },
301
301
  devDependencies: {
302
302
  '@vitejs/plugin-react': '^4.2.1',
303
+ autoprefixer: '^10.4.18',
304
+ postcss: '^8.4.35',
303
305
  react: '^18.2.0',
304
306
  'react-dom': '^18.2.0',
305
307
  'react-router-dom': '^6.22.0',
308
+ tailwindcss: '^3.4.1',
306
309
  vite: '^5.1.0',
307
310
  'vite-plugin-svgr': '^4.2.0',
308
311
  },
309
312
  })
310
313
 
311
- // vite.config.js
314
+ // Foundation import name
312
315
  const foundationImport = isWorkspace ? 'foundation' : 'foundation-example'
316
+
317
+ // tailwind.config.js - scan foundation components
318
+ const foundationPath = isWorkspace ? '../foundation' : `./node_modules/${foundationImport}`
319
+ writeFile(join(projectDir, 'tailwind.config.js'), `export default {
320
+ content: ['${foundationPath}/src/**/*.{js,jsx,ts,tsx}'],
321
+ theme: {
322
+ extend: {
323
+ colors: {
324
+ primary: '#3b82f6',
325
+ secondary: '#64748b',
326
+ },
327
+ },
328
+ },
329
+ plugins: [],
330
+ }
331
+ `)
332
+
333
+ // postcss.config.js
334
+ writeFile(join(projectDir, 'postcss.config.js'), `export default {
335
+ plugins: {
336
+ tailwindcss: {},
337
+ autoprefixer: {},
338
+ },
339
+ }
340
+ `)
341
+
342
+ // vite.config.js
313
343
  writeFile(join(projectDir, 'vite.config.js'), `import { defineConfig } from 'vite'
314
344
  import react from '@vitejs/plugin-react'
315
345
  import svgr from 'vite-plugin-svgr'