@undp/create-app 0.2.8 → 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.
@@ -8,7 +8,7 @@ export function generateIndexHtml(config) {
8
8
  <title>${config.projectName}</title>
9
9
  </head>
10
10
  <body>
11
- ${!config.addPostCSSScripts ? `<div id="root"></div>` : `<div id="undp-container">
11
+ ${!config.addPostCSSScripts ? `<div id="root"></div>` : `<div class="undp-container">
12
12
  <div id="root"></div>
13
13
  </div>` }
14
14
  <script type="module" src="/src/main.tsx"></script>
@@ -102,7 +102,7 @@ export function generatePackageJson(config) {
102
102
  "@tailwindcss/postcss": "^4.1.17",
103
103
  "@types/node": "^24.10.0",
104
104
  "@types/react": "^19.2.7",
105
- "@types/react-dom": "^19.2.7",
105
+ "@types/react-dom": "^19.2.3",
106
106
  "eslint": "^9.39.1",
107
107
  "eslint-config-love": "^133.0.0",
108
108
  "eslint-config-next": "16.0.1",
@@ -58,24 +58,36 @@ export default defineConfig({
58
58
  });
59
59
  });
60
60
  },
61
- },` : ''}
61
+ },
62
62
  {
63
- postcssPlugin: 'move-media-queries-last', // If you want to reorder media queries to the end
63
+ postcssPlugin: 'move-media-queries-by-breakpoint',
64
64
  OnceExit(root) {
65
- const mediaQueries = [];
65
+ const mediaRules = [];
66
66
 
67
- // Collect all media queries
68
- root.walkAtRules('media', mediaRule => {
69
- mediaQueries.push(mediaRule.clone());
70
- mediaRule.remove();
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
- // Append them at the end
74
- mediaQueries.forEach(mediaQuery => {
75
- root.append(mediaQuery);
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@undp/create-app",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "UNDP's project scaffolding tool",
5
5
  "bin": {
6
6
  "create-undp-app": "./bin/index.js"
@@ -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
- }