artharexian-ui 0.2.3 → 0.2.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/cli/index.mjs +17 -12
  2. package/package.json +1 -1
package/cli/index.mjs CHANGED
@@ -44,29 +44,34 @@ function ensureCssImport() {
44
44
 
45
45
  let code = fs.readFileSync(mainFile, 'utf8')
46
46
 
47
- if (code.includes('artharexian-ui/css')) return
47
+ // Check if local styles import exists
48
+ if (code.includes('./styles/style.css') || code.includes('@/styles/style.css')) return
48
49
 
49
- code = `import 'artharexian-ui/css'\n` + code
50
+ code = `import './styles/style.css'\n` + code
50
51
  fs.writeFileSync(mainFile, code)
51
- console.log('✔ CSS import added to src/main')
52
+ console.log('✔ Style import added to src/main')
52
53
  }
53
54
 
54
55
  function copyStyles() {
55
- const stylesSrc = path.join(registryRoot, '../src/styles')
56
+ const stylesSrc = path.resolve(cwd, 'node_modules/artharexian-ui/src/styles')
56
57
  const stylesDst = path.resolve(cwd, 'src/styles')
57
58
 
58
59
  if (!fs.existsSync(stylesSrc)) {
59
- // Fallback to node_modules
60
- const nmStyles = path.resolve(cwd, 'node_modules/artharexian-ui/src/styles')
61
- if (fs.existsSync(nmStyles)) {
62
- copyDir(nmStyles, stylesDst)
63
- console.log('✔ Styles copied to src/styles')
64
- }
60
+ console.log('⚠ Styles not found in package')
65
61
  return
66
62
  }
67
63
 
68
- copyDir(stylesSrc, stylesDst)
69
- console.log('✔ Styles copied to src/styles')
64
+ fs.mkdirSync(stylesDst, { recursive: true })
65
+
66
+ // Copy all CSS files from package to project
67
+ for (const file of fs.readdirSync(stylesSrc)) {
68
+ if (file.endsWith('.css')) {
69
+ const srcFile = path.join(stylesSrc, file)
70
+ const dstFile = path.join(stylesDst, file)
71
+ fs.copyFileSync(srcFile, dstFile)
72
+ console.log(`✔ ${file} installed to src/styles/${file}`)
73
+ }
74
+ }
70
75
  }
71
76
 
72
77
  if (!command) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "artharexian-ui",
3
3
  "description": "Vue 3 UI component library",
4
- "version": "0.2.3",
4
+ "version": "0.2.4",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "type": "module",