@granite-js/plugin-router 0.1.29 → 0.1.31
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/CHANGELOG.md +15 -0
- package/dist/index.cjs +14 -1
- package/dist/index.js +14 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @granite-js/plugin-router
|
|
2
2
|
|
|
3
|
+
## 0.1.31
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 37ae3f3: feat(router): supports standard schema
|
|
8
|
+
- Updated dependencies [9bf8b50]
|
|
9
|
+
- Updated dependencies [e957833]
|
|
10
|
+
- @granite-js/plugin-core@0.1.31
|
|
11
|
+
|
|
12
|
+
## 0.1.30
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- @granite-js/plugin-core@0.1.30
|
|
17
|
+
|
|
3
18
|
## 0.1.29
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -100,6 +100,10 @@ const ROUTER_GEN_TEMPLATE = `/* eslint-disable */
|
|
|
100
100
|
%%pageImports%%
|
|
101
101
|
|
|
102
102
|
declare module '@granite-js/react-native' {
|
|
103
|
+
interface RegisterScreenInput {
|
|
104
|
+
%%pageInputRoutes%%
|
|
105
|
+
}
|
|
106
|
+
|
|
103
107
|
interface RegisterScreen {
|
|
104
108
|
%%pageRoutes%%
|
|
105
109
|
}
|
|
@@ -163,16 +167,25 @@ function generateRouterFile() {
|
|
|
163
167
|
pagePath
|
|
164
168
|
});
|
|
165
169
|
}).join("\n");
|
|
170
|
+
const pageInputRoutes = pageFiles.map((page) => {
|
|
171
|
+
const componentName = getComponentName(page);
|
|
172
|
+
const pagePath = getPath(page);
|
|
173
|
+
return transformTemplate(" '%%pagePath%%': (typeof _%%componentName%%Route)['_inputType'];", {
|
|
174
|
+
componentName,
|
|
175
|
+
pagePath
|
|
176
|
+
});
|
|
177
|
+
}).join("\n");
|
|
166
178
|
const pageRoutes = pageFiles.map((page) => {
|
|
167
179
|
const componentName = getComponentName(page);
|
|
168
180
|
const pagePath = getPath(page);
|
|
169
|
-
return transformTemplate(" '%%pagePath%%':
|
|
181
|
+
return transformTemplate(" '%%pagePath%%': (typeof _%%componentName%%Route)['_outputType'];", {
|
|
170
182
|
componentName,
|
|
171
183
|
pagePath
|
|
172
184
|
});
|
|
173
185
|
}).join("\n");
|
|
174
186
|
const generatedContent = transformTemplate(ROUTER_GEN_TEMPLATE, {
|
|
175
187
|
pageImports,
|
|
188
|
+
pageInputRoutes,
|
|
176
189
|
pageRoutes
|
|
177
190
|
});
|
|
178
191
|
const routerFilePath = (0, path.join)(cwd, "src", "router.gen.ts");
|
package/dist/index.js
CHANGED
|
@@ -77,6 +77,10 @@ const ROUTER_GEN_TEMPLATE = `/* eslint-disable */
|
|
|
77
77
|
%%pageImports%%
|
|
78
78
|
|
|
79
79
|
declare module '@granite-js/react-native' {
|
|
80
|
+
interface RegisterScreenInput {
|
|
81
|
+
%%pageInputRoutes%%
|
|
82
|
+
}
|
|
83
|
+
|
|
80
84
|
interface RegisterScreen {
|
|
81
85
|
%%pageRoutes%%
|
|
82
86
|
}
|
|
@@ -140,16 +144,25 @@ function generateRouterFile() {
|
|
|
140
144
|
pagePath
|
|
141
145
|
});
|
|
142
146
|
}).join("\n");
|
|
147
|
+
const pageInputRoutes = pageFiles.map((page) => {
|
|
148
|
+
const componentName = getComponentName(page);
|
|
149
|
+
const pagePath = getPath(page);
|
|
150
|
+
return transformTemplate(" '%%pagePath%%': (typeof _%%componentName%%Route)['_inputType'];", {
|
|
151
|
+
componentName,
|
|
152
|
+
pagePath
|
|
153
|
+
});
|
|
154
|
+
}).join("\n");
|
|
143
155
|
const pageRoutes = pageFiles.map((page) => {
|
|
144
156
|
const componentName = getComponentName(page);
|
|
145
157
|
const pagePath = getPath(page);
|
|
146
|
-
return transformTemplate(" '%%pagePath%%':
|
|
158
|
+
return transformTemplate(" '%%pagePath%%': (typeof _%%componentName%%Route)['_outputType'];", {
|
|
147
159
|
componentName,
|
|
148
160
|
pagePath
|
|
149
161
|
});
|
|
150
162
|
}).join("\n");
|
|
151
163
|
const generatedContent = transformTemplate(ROUTER_GEN_TEMPLATE, {
|
|
152
164
|
pageImports,
|
|
165
|
+
pageInputRoutes,
|
|
153
166
|
pageRoutes
|
|
154
167
|
});
|
|
155
168
|
const routerFilePath = join(cwd, "src", "router.gen.ts");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@granite-js/plugin-router",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.31",
|
|
5
5
|
"description": "A Route Generator for Granite project",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"vitest": "^2.1.8"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@granite-js/plugin-core": "0.1.
|
|
44
|
+
"@granite-js/plugin-core": "0.1.31",
|
|
45
45
|
"@swc/core": "1.5.24",
|
|
46
46
|
"chokidar": "4.0.1",
|
|
47
47
|
"es-toolkit": "^1.39.8"
|