create-pb-app 1.0.9 → 1.1.1
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 +1 -1
- package/src/templates.js +16 -28
package/package.json
CHANGED
package/src/templates.js
CHANGED
|
@@ -41,7 +41,7 @@ export function getTemplates(projectName) {
|
|
|
41
41
|
skipLibCheck: true,
|
|
42
42
|
outDir: './dist'
|
|
43
43
|
},
|
|
44
|
-
include: ['
|
|
44
|
+
include: ['app/**/*', 'pages/**/*']
|
|
45
45
|
}, null, 4) + '\n'
|
|
46
46
|
},
|
|
47
47
|
{
|
|
@@ -60,17 +60,10 @@ export default defineConfig({});
|
|
|
60
60
|
<meta charset="UTF-8">
|
|
61
61
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
62
62
|
<title>${projectName}</title>
|
|
63
|
-
<style>
|
|
64
|
-
@font-face {
|
|
65
|
-
font-family: 'Neue Montreal';
|
|
66
|
-
src: url('/fonts/NeueMontreal.woff2') format('woff2');
|
|
67
|
-
font-display: swap;
|
|
68
|
-
}
|
|
69
|
-
</style>
|
|
70
63
|
</head>
|
|
71
64
|
|
|
72
65
|
<body>
|
|
73
|
-
<script type="module" src="./
|
|
66
|
+
<script type="module" src="./app/app.tsx"></script>
|
|
74
67
|
</body>
|
|
75
68
|
|
|
76
69
|
</html>
|
|
@@ -94,25 +87,30 @@ dist
|
|
|
94
87
|
}, null, 4) + '\n'
|
|
95
88
|
},
|
|
96
89
|
{
|
|
97
|
-
filePath: '
|
|
90
|
+
filePath: 'app/app.tsx',
|
|
98
91
|
content: `import { render } from 'jsx-framework-test-pb';
|
|
99
|
-
import { Home } from '../
|
|
92
|
+
import { Home } from '../pages/home';
|
|
100
93
|
import { createRouter, RouterView } from 'looserouter-test-pb';
|
|
101
|
-
import {
|
|
94
|
+
import { Layout } from './layout';
|
|
102
95
|
import { makeStaticStyles } from 'css-engine-test-pb';
|
|
103
96
|
|
|
104
97
|
const useStaticStyles = makeStaticStyles({
|
|
98
|
+
'@font-face': {
|
|
99
|
+
fontFamily: 'Neue Montreal',
|
|
100
|
+
src: 'url("/fonts/NeueMontreal.woff2") format("woff2")',
|
|
101
|
+
fontWeight: '1 999',
|
|
102
|
+
fontDisplay: 'block'
|
|
103
|
+
},
|
|
105
104
|
body: {
|
|
106
105
|
margin: 0,
|
|
107
|
-
fontFamily: '
|
|
108
|
-
boxSizing: 'border-box'
|
|
106
|
+
fontFamily: 'Neue Montreal'
|
|
109
107
|
}
|
|
110
108
|
});
|
|
111
109
|
|
|
112
110
|
useStaticStyles();
|
|
113
111
|
|
|
114
112
|
const router = createRouter({
|
|
115
|
-
'/': (ctx) => <
|
|
113
|
+
'/': (ctx) => <Layout><Home /></Layout>
|
|
116
114
|
});
|
|
117
115
|
|
|
118
116
|
const App = () => <RouterView router={router} />;
|
|
@@ -121,7 +119,7 @@ render(<App />, document.body);
|
|
|
121
119
|
`
|
|
122
120
|
},
|
|
123
121
|
{
|
|
124
|
-
filePath: '
|
|
122
|
+
filePath: 'pages/home.tsx',
|
|
125
123
|
content: `import { Text } from 'components-test-pb';
|
|
126
124
|
|
|
127
125
|
export function Home() {
|
|
@@ -134,13 +132,8 @@ export function Home() {
|
|
|
134
132
|
`
|
|
135
133
|
},
|
|
136
134
|
{
|
|
137
|
-
filePath: '
|
|
138
|
-
content: `export {
|
|
139
|
-
`
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
filePath: 'src/layouts/Main.tsx',
|
|
143
|
-
content: `export function Main({ children }) {
|
|
135
|
+
filePath: 'app/layout.tsx',
|
|
136
|
+
content: `export function Layout({ children }) {
|
|
144
137
|
return (
|
|
145
138
|
<>
|
|
146
139
|
<header></header>
|
|
@@ -149,11 +142,6 @@ export function Home() {
|
|
|
149
142
|
</>
|
|
150
143
|
);
|
|
151
144
|
}
|
|
152
|
-
`
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
filePath: 'src/layouts/index.ts',
|
|
156
|
-
content: `export { Main } from './Main';
|
|
157
145
|
`
|
|
158
146
|
}
|
|
159
147
|
];
|