vaderjs 2.1.8 → 2.2.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vaderjs",
3
- "version": "2.1.8",
3
+ "version": "2.2.0",
4
4
  "description": "A simple and powerful JavaScript library for building modern web applications.",
5
5
  "bin": {
6
6
  "vaderjs": "./main.js"
@@ -13,29 +13,15 @@ function checkIfTailwindInstalled() {
13
13
 
14
14
  function initTailwind() {
15
15
  const tailwindConfig = path.resolve(process.cwd(), 'tailwind.config.js')
16
- const postcssConfig = path.resolve(process.cwd(), 'postcss.config.js')
16
+ const postcssConfig = path.resolve(process.cwd(), 'postcss.config.mjs')
17
17
  const tailwindCssFile = path.join(process.cwd(), '/public/styles.css')
18
18
  if(!fs.existsSync(tailwindCssFile)){
19
19
  fs.writeFileSync(tailwindCssFile, `@import "tailwindcss"`)
20
20
  }
21
- if (!fs.existsSync(tailwindConfig)) {
22
- fs.writeFileSync(postcssConfig, `module.exports = {
23
- plugins: {
24
- tailwindcss: {},
25
- autoprefixer: {},
26
- }
27
- }`)
21
+ if (!fs.existsSync(postcssConfig)) {
22
+ fs.writeFileSync(postcssConfig, `export default { plugins: { "@tailwindcss/postcss": {}, }}`)
28
23
 
29
- fs.writeFileSync(tailwindConfig, `/** @type {import('tailwindcss').Config} */
30
- module.exports = {
31
- content: ['./src/**/*.{html,js,jsx,ts,tsx}', './app/**/*.{html,js,jsx,ts,tsx}'],
32
- theme: {
33
- extend: {},
34
- },
35
- plugins: [],
36
- }`)
37
-
38
- }
24
+ }
39
25
 
40
26
  }
41
27
 
@@ -46,19 +32,11 @@ export default {
46
32
  version: '0.0.2',
47
33
  onBuildStart: async (vader) => {
48
34
  if (!checkIfTailwindInstalled()) {
49
- console.error('TailwindCSS is not installed. Please install it using `bun install tailwindcss @tailwindcss/postcss postcss \n more info: https://tailwindcss.com/docs/installation/using-postcss`')
35
+ console.error('TailwindCSS is not installed. Please install it using `bun install tailwindcss @tailwindcss/postcss postcss-cli`\n more info: https://tailwindcss.com/docs/installation/using-postcss`')
50
36
  process.exit(1)
51
37
  }else{
52
38
  initTailwind()
53
39
  console.log('Building TailwindCSS...')
54
-
55
- if(vader.isDev){
56
- vader.onFileChange('tailwind.config.js', async () => {
57
- console.log('Rebuilding TailwindCSS...')
58
- await vader.runCommand(['bun', 'run', 'postcss', './public/styles.css', '-o', 'dist/public/tailwind.css'])
59
- vader.injectHTML(`<link rel="stylesheet" href="/public/tailwind.css">`)
60
- })
61
- }
62
40
  await vader.runCommand(['bun', 'run', 'postcss', './public/styles.css', '-o', 'dist/public/tailwind.css'])
63
41
  vader.injectHTML(`<link rel="stylesheet" href="/public/tailwind.css">`)
64
42