create-pb-app 1.1.0 → 1.1.2
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 -18
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
|
{
|
|
@@ -63,7 +63,7 @@ export default defineConfig({});
|
|
|
63
63
|
</head>
|
|
64
64
|
|
|
65
65
|
<body>
|
|
66
|
-
<script type="module" src="./
|
|
66
|
+
<script type="module" src="./app/app.tsx"></script>
|
|
67
67
|
</body>
|
|
68
68
|
|
|
69
69
|
</html>
|
|
@@ -87,17 +87,17 @@ dist
|
|
|
87
87
|
}, null, 4) + '\n'
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
|
-
filePath: '
|
|
90
|
+
filePath: 'app/app.tsx',
|
|
91
91
|
content: `import { render } from 'jsx-framework-test-pb';
|
|
92
|
-
import { Home } from '../
|
|
92
|
+
import { Home } from '../pages';
|
|
93
93
|
import { createRouter, RouterView } from 'looserouter-test-pb';
|
|
94
|
-
import {
|
|
94
|
+
import { Layout } from './layout';
|
|
95
95
|
import { makeStaticStyles } from 'css-engine-test-pb';
|
|
96
96
|
|
|
97
97
|
const useStaticStyles = makeStaticStyles({
|
|
98
98
|
'@font-face': {
|
|
99
99
|
fontFamily: 'Neue Montreal',
|
|
100
|
-
src: 'url("
|
|
100
|
+
src: 'url("/fonts/NeueMontreal.woff2") format("woff2")',
|
|
101
101
|
fontWeight: '1 999',
|
|
102
102
|
fontDisplay: 'block'
|
|
103
103
|
},
|
|
@@ -110,7 +110,7 @@ const useStaticStyles = makeStaticStyles({
|
|
|
110
110
|
useStaticStyles();
|
|
111
111
|
|
|
112
112
|
const router = createRouter({
|
|
113
|
-
'/': (ctx) => <
|
|
113
|
+
'/': (ctx) => <Layout><Home /></Layout>
|
|
114
114
|
});
|
|
115
115
|
|
|
116
116
|
const App = () => <RouterView router={router} />;
|
|
@@ -119,7 +119,7 @@ render(<App />, document.body);
|
|
|
119
119
|
`
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
|
-
filePath: '
|
|
122
|
+
filePath: 'pages/home/home.tsx',
|
|
123
123
|
content: `import { Text } from 'components-test-pb';
|
|
124
124
|
|
|
125
125
|
export function Home() {
|
|
@@ -132,13 +132,16 @@ export function Home() {
|
|
|
132
132
|
`
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
|
-
filePath: '
|
|
136
|
-
content: `export { Home } from './
|
|
137
|
-
|
|
135
|
+
filePath: 'pages/home/index.ts',
|
|
136
|
+
content: `export { Home } from './home';`
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
filePath: 'pages/index.ts',
|
|
140
|
+
content: `export { Home } from './home;`
|
|
138
141
|
},
|
|
139
142
|
{
|
|
140
|
-
filePath: '
|
|
141
|
-
content: `export function
|
|
143
|
+
filePath: 'app/layout.tsx',
|
|
144
|
+
content: `export function Layout({ children }) {
|
|
142
145
|
return (
|
|
143
146
|
<>
|
|
144
147
|
<header></header>
|
|
@@ -147,11 +150,6 @@ export function Home() {
|
|
|
147
150
|
</>
|
|
148
151
|
);
|
|
149
152
|
}
|
|
150
|
-
`
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
filePath: 'src/layouts/index.ts',
|
|
154
|
-
content: `export { Main } from './Main';
|
|
155
153
|
`
|
|
156
154
|
}
|
|
157
155
|
];
|