@undp/create-app 0.2.9 → 0.2.10
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/generateFiles/generateViteConfig.js +24 -12
- package/bin/templates/vite/basic/vite.config.ts +0 -17
- package/bin/templates/vite/query/vite.config.ts +0 -17
- package/bin/templates/vite/query+router/vite.config.ts +0 -17
- package/bin/templates/vite/router/vite.config.ts +0 -17
- package/package.json +1 -1
- package/bin/templates/vite/basic/src/components/Footer.tsx +0 -14
- package/bin/templates/vite/basic/src/components/Header.tsx +0 -25
- package/bin/templates/vite/query/src/components/Footer.tsx +0 -14
- package/bin/templates/vite/query/src/components/Header.tsx +0 -25
|
@@ -58,24 +58,36 @@ export default defineConfig({
|
|
|
58
58
|
});
|
|
59
59
|
});
|
|
60
60
|
},
|
|
61
|
-
}
|
|
61
|
+
},
|
|
62
62
|
{
|
|
63
|
-
postcssPlugin: 'move-media-queries-
|
|
63
|
+
postcssPlugin: 'move-media-queries-by-breakpoint',
|
|
64
64
|
OnceExit(root) {
|
|
65
|
-
const
|
|
65
|
+
const mediaRules = [];
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
root.walkAtRules('media', rule => {
|
|
68
|
+
const match = rule.params.match(/min-width:\s*([\d.]+)(px|rem)/);
|
|
69
|
+
|
|
70
|
+
if (!match) return;
|
|
71
|
+
|
|
72
|
+
const value = parseFloat(match[1]);
|
|
73
|
+
const unit = match[2];
|
|
74
|
+
|
|
75
|
+
// Normalize to px (assuming 16px root for sorting)
|
|
76
|
+
const pxValue = unit === 'rem' ? value * 16 : value;
|
|
72
77
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
mediaRules.push({
|
|
79
|
+
pxValue,
|
|
80
|
+
rule: rule.clone(),
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
rule.remove();
|
|
76
84
|
});
|
|
85
|
+
|
|
86
|
+
mediaRules
|
|
87
|
+
.sort((a, b) => a.pxValue - b.pxValue)
|
|
88
|
+
.forEach(({ rule }) => root.append(rule));
|
|
77
89
|
},
|
|
78
|
-
}
|
|
90
|
+
},` : ''}
|
|
79
91
|
],
|
|
80
92
|
},
|
|
81
93
|
},
|
|
@@ -26,23 +26,6 @@ export default defineConfig({
|
|
|
26
26
|
plugins: [
|
|
27
27
|
postcssNested(),
|
|
28
28
|
tailwindcss(),
|
|
29
|
-
{
|
|
30
|
-
postcssPlugin: 'move-media-queries-last', // If you want to reorder media queries to the end
|
|
31
|
-
OnceExit(root) {
|
|
32
|
-
const mediaQueries = [];
|
|
33
|
-
|
|
34
|
-
// Collect all media queries
|
|
35
|
-
root.walkAtRules('media', mediaRule => {
|
|
36
|
-
mediaQueries.push(mediaRule.clone());
|
|
37
|
-
mediaRule.remove();
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// Append them at the end
|
|
41
|
-
mediaQueries.forEach(mediaQuery => {
|
|
42
|
-
root.append(mediaQuery);
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
29
|
],
|
|
47
30
|
},
|
|
48
31
|
},
|
|
@@ -26,23 +26,6 @@ export default defineConfig({
|
|
|
26
26
|
plugins: [
|
|
27
27
|
postcssNested(),
|
|
28
28
|
tailwindcss(),
|
|
29
|
-
{
|
|
30
|
-
postcssPlugin: 'move-media-queries-last', // If you want to reorder media queries to the end
|
|
31
|
-
OnceExit(root) {
|
|
32
|
-
const mediaQueries = [];
|
|
33
|
-
|
|
34
|
-
// Collect all media queries
|
|
35
|
-
root.walkAtRules('media', mediaRule => {
|
|
36
|
-
mediaQueries.push(mediaRule.clone());
|
|
37
|
-
mediaRule.remove();
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// Append them at the end
|
|
41
|
-
mediaQueries.forEach(mediaQuery => {
|
|
42
|
-
root.append(mediaQuery);
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
29
|
],
|
|
47
30
|
},
|
|
48
31
|
},
|
|
@@ -26,23 +26,6 @@ export default defineConfig({
|
|
|
26
26
|
plugins: [
|
|
27
27
|
postcssNested(),
|
|
28
28
|
tailwindcss(),
|
|
29
|
-
{
|
|
30
|
-
postcssPlugin: 'move-media-queries-last', // If you want to reorder media queries to the end
|
|
31
|
-
OnceExit(root) {
|
|
32
|
-
const mediaQueries = [];
|
|
33
|
-
|
|
34
|
-
// Collect all media queries
|
|
35
|
-
root.walkAtRules('media', mediaRule => {
|
|
36
|
-
mediaQueries.push(mediaRule.clone());
|
|
37
|
-
mediaRule.remove();
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// Append them at the end
|
|
41
|
-
mediaQueries.forEach(mediaQuery => {
|
|
42
|
-
root.append(mediaQuery);
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
29
|
],
|
|
47
30
|
},
|
|
48
31
|
},
|
|
@@ -26,23 +26,6 @@ export default defineConfig({
|
|
|
26
26
|
plugins: [
|
|
27
27
|
postcssNested(),
|
|
28
28
|
tailwindcss(),
|
|
29
|
-
{
|
|
30
|
-
postcssPlugin: 'move-media-queries-last', // If you want to reorder media queries to the end
|
|
31
|
-
OnceExit(root) {
|
|
32
|
-
const mediaQueries = [];
|
|
33
|
-
|
|
34
|
-
// Collect all media queries
|
|
35
|
-
root.walkAtRules('media', mediaRule => {
|
|
36
|
-
mediaQueries.push(mediaRule.clone());
|
|
37
|
-
mediaRule.remove();
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// Append them at the end
|
|
41
|
-
mediaQueries.forEach(mediaQuery => {
|
|
42
|
-
root.append(mediaQuery);
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
29
|
],
|
|
47
30
|
},
|
|
48
31
|
},
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Footer,
|
|
3
|
-
FooterLogoUnit,
|
|
4
|
-
FooterCopyrightUnit,
|
|
5
|
-
} from '@undp/design-system-react/Footer';
|
|
6
|
-
|
|
7
|
-
export default function FooterEl() {
|
|
8
|
-
return (
|
|
9
|
-
<Footer>
|
|
10
|
-
<FooterLogoUnit>subscribe to email</FooterLogoUnit>
|
|
11
|
-
<FooterCopyrightUnit>Footnote can be added here</FooterCopyrightUnit>
|
|
12
|
-
</Footer>
|
|
13
|
-
);
|
|
14
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Header,
|
|
3
|
-
HeaderLogoUnit,
|
|
4
|
-
HeaderMainNavUnit,
|
|
5
|
-
HeaderMenuUnit,
|
|
6
|
-
} from '@undp/design-system-react/Header';
|
|
7
|
-
import { Link } from '@tanstack/react-router';
|
|
8
|
-
|
|
9
|
-
export default function HeaderEl() {
|
|
10
|
-
return (
|
|
11
|
-
<Header>
|
|
12
|
-
<HeaderLogoUnit
|
|
13
|
-
hyperlink='./'
|
|
14
|
-
siteName='Site name'
|
|
15
|
-
siteSubName='Sub-site name'
|
|
16
|
-
/>
|
|
17
|
-
<HeaderMainNavUnit>
|
|
18
|
-
<HeaderMenuUnit>
|
|
19
|
-
<Link to='/'>Home</Link>
|
|
20
|
-
<Link to='/query-demo'>Query demo</Link>
|
|
21
|
-
</HeaderMenuUnit>
|
|
22
|
-
</HeaderMainNavUnit>
|
|
23
|
-
</Header>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Footer,
|
|
3
|
-
FooterLogoUnit,
|
|
4
|
-
FooterCopyrightUnit,
|
|
5
|
-
} from '@undp/design-system-react/Footer';
|
|
6
|
-
|
|
7
|
-
export default function FooterEl() {
|
|
8
|
-
return (
|
|
9
|
-
<Footer>
|
|
10
|
-
<FooterLogoUnit>subscribe to email</FooterLogoUnit>
|
|
11
|
-
<FooterCopyrightUnit>Footnote can be added here</FooterCopyrightUnit>
|
|
12
|
-
</Footer>
|
|
13
|
-
);
|
|
14
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Header,
|
|
3
|
-
HeaderLogoUnit,
|
|
4
|
-
HeaderMainNavUnit,
|
|
5
|
-
HeaderMenuUnit,
|
|
6
|
-
} from '@undp/design-system-react/Header';
|
|
7
|
-
import { Link } from '@tanstack/react-router';
|
|
8
|
-
|
|
9
|
-
export default function HeaderEl() {
|
|
10
|
-
return (
|
|
11
|
-
<Header>
|
|
12
|
-
<HeaderLogoUnit
|
|
13
|
-
hyperlink='./'
|
|
14
|
-
siteName='Site name'
|
|
15
|
-
siteSubName='Sub-site name'
|
|
16
|
-
/>
|
|
17
|
-
<HeaderMainNavUnit>
|
|
18
|
-
<HeaderMenuUnit>
|
|
19
|
-
<Link to='/'>Home</Link>
|
|
20
|
-
<Link to='/query-demo'>Query demo</Link>
|
|
21
|
-
</HeaderMenuUnit>
|
|
22
|
-
</HeaderMainNavUnit>
|
|
23
|
-
</Header>
|
|
24
|
-
);
|
|
25
|
-
}
|