sunpeak 0.2.2 → 0.2.3
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/bin/sunpeak.js +5 -0
- package/package.json +1 -1
- package/template/dev/styles.css +1 -0
- package/template/vite.config.ts +3 -12
package/bin/sunpeak.js
CHANGED
|
@@ -25,6 +25,11 @@ async function init(projectName) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
if (projectName === 'template') {
|
|
29
|
+
console.error('Error: "template" is a reserved name. Please choose another name.');
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
|
|
28
33
|
const targetDir = join(process.cwd(), projectName);
|
|
29
34
|
|
|
30
35
|
if (existsSync(targetDir)) {
|
package/package.json
CHANGED
package/template/dev/styles.css
CHANGED
package/template/vite.config.ts
CHANGED
|
@@ -2,19 +2,10 @@ import { defineConfig } from 'vite';
|
|
|
2
2
|
import react from '@vitejs/plugin-react';
|
|
3
3
|
import tailwindcss from '@tailwindcss/vite';
|
|
4
4
|
import path from 'path';
|
|
5
|
-
import fs from 'fs';
|
|
6
5
|
|
|
7
|
-
// Check if we're in the sunpeak workspace
|
|
8
|
-
const
|
|
6
|
+
// Check if we're in the sunpeak workspace (directory is named "template")
|
|
7
|
+
const isTemplate = path.basename(__dirname) === 'template';
|
|
9
8
|
const parentSrc = path.resolve(__dirname, '../src');
|
|
10
|
-
let isSunpeakWorkspace = false;
|
|
11
|
-
|
|
12
|
-
if (fs.existsSync(parentPkgPath) && fs.existsSync(parentSrc)) {
|
|
13
|
-
try {
|
|
14
|
-
const parentPkg = JSON.parse(fs.readFileSync(parentPkgPath, 'utf-8'));
|
|
15
|
-
isSunpeakWorkspace = parentPkg.name === 'sunpeak';
|
|
16
|
-
} catch {}
|
|
17
|
-
}
|
|
18
9
|
|
|
19
10
|
export default defineConfig({
|
|
20
11
|
plugins: [react(), tailwindcss()],
|
|
@@ -22,7 +13,7 @@ export default defineConfig({
|
|
|
22
13
|
alias: {
|
|
23
14
|
'@': path.resolve(__dirname, './src'),
|
|
24
15
|
// In workspace dev mode, use local sunpeak source
|
|
25
|
-
...(
|
|
16
|
+
...(isTemplate && {
|
|
26
17
|
'sunpeak': parentSrc,
|
|
27
18
|
'~': parentSrc,
|
|
28
19
|
}),
|