uniweb 0.1.2 → 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 +34 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uniweb",
3
- "version": "0.1.2",
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
@@ -246,6 +246,9 @@ async function createWorkspace(projectDir, projectName) {
246
246
  'build:foundation': 'pnpm --filter foundation build',
247
247
  build: 'pnpm build:foundation && pnpm --filter site build',
248
248
  },
249
+ pnpm: {
250
+ onlyBuiltDependencies: ['esbuild', 'sharp'],
251
+ },
249
252
  })
250
253
 
251
254
  // pnpm-workspace.yaml
@@ -260,12 +263,6 @@ dist
260
263
  *.local
261
264
  `)
262
265
 
263
- // .npmrc - approve build scripts for known packages
264
- writeFile(join(projectDir, '.npmrc'), `onlyBuiltDependencies:
265
- - esbuild
266
- - sharp
267
- `)
268
-
269
266
  // Create site package
270
267
  await createSite(join(projectDir, 'packages/site'), 'site', true)
271
268
 
@@ -303,16 +300,46 @@ async function createSite(projectDir, projectName, isWorkspace = false) {
303
300
  },
304
301
  devDependencies: {
305
302
  '@vitejs/plugin-react': '^4.2.1',
303
+ autoprefixer: '^10.4.18',
304
+ postcss: '^8.4.35',
306
305
  react: '^18.2.0',
307
306
  'react-dom': '^18.2.0',
308
307
  'react-router-dom': '^6.22.0',
308
+ tailwindcss: '^3.4.1',
309
309
  vite: '^5.1.0',
310
310
  'vite-plugin-svgr': '^4.2.0',
311
311
  },
312
312
  })
313
313
 
314
- // vite.config.js
314
+ // Foundation import name
315
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
316
343
  writeFile(join(projectDir, 'vite.config.js'), `import { defineConfig } from 'vite'
317
344
  import react from '@vitejs/plugin-react'
318
345
  import svgr from 'vite-plugin-svgr'