@modern-js/app-tools 2.32.1 → 2.33.0
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 +38 -0
- package/dist/cjs/analyze/constants.js +8 -6
- package/dist/cjs/analyze/nestedRoutes.js +14 -0
- package/dist/esm/analyze/constants.js +8 -6
- package/dist/esm/analyze/nestedRoutes.js +15 -1
- package/dist/esm-node/analyze/constants.js +8 -6
- package/dist/esm-node/analyze/nestedRoutes.js +14 -0
- package/dist/types/analyze/constants.d.ts +6 -4
- package/dist/types/types/config/source.d.ts +2 -4
- package/dist/types/types/legacyConfig/source.d.ts +2 -3
- package/package.json +24 -24
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,43 @@
|
|
1
1
|
# @modern-js/app-tools
|
2
2
|
|
3
|
+
## 2.33.0
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- f13ce4f: fix: should support data file for splat routes
|
8
|
+
fix 对于通配路由,应该支持 data 文件
|
9
|
+
- Updated dependencies [1c812c2]
|
10
|
+
- Updated dependencies [ecb9276]
|
11
|
+
- Updated dependencies [c9ffc4d]
|
12
|
+
- Updated dependencies [915636b]
|
13
|
+
- Updated dependencies [1c6c029]
|
14
|
+
- Updated dependencies [f96d565]
|
15
|
+
- Updated dependencies [fd82137]
|
16
|
+
- Updated dependencies [1042583]
|
17
|
+
- Updated dependencies [d55caa9]
|
18
|
+
- Updated dependencies [bc1f8da]
|
19
|
+
- Updated dependencies [64df945]
|
20
|
+
- Updated dependencies [3ba1682]
|
21
|
+
- @modern-js/builder-rspack-provider@2.33.0
|
22
|
+
- @modern-js/core@2.33.0
|
23
|
+
- @modern-js/builder-shared@2.33.0
|
24
|
+
- @modern-js/builder-plugin-esbuild@2.33.0
|
25
|
+
- @modern-js/builder@2.33.0
|
26
|
+
- @modern-js/utils@2.33.0
|
27
|
+
- @modern-js/prod-server@2.33.0
|
28
|
+
- @modern-js/builder-plugin-node-polyfill@2.33.0
|
29
|
+
- @modern-js/plugin-data-loader@2.33.0
|
30
|
+
- @modern-js/plugin-lint@2.33.0
|
31
|
+
- @modern-js/builder-webpack-provider@2.33.0
|
32
|
+
- @modern-js/new-action@2.33.0
|
33
|
+
- @modern-js/plugin-i18n@2.33.0
|
34
|
+
- @modern-js/server-core@2.33.0
|
35
|
+
- @modern-js/server@2.33.0
|
36
|
+
- @modern-js/node-bundle-require@2.33.0
|
37
|
+
- @modern-js/plugin@2.33.0
|
38
|
+
- @modern-js/upgrade@2.33.0
|
39
|
+
- @modern-js/types@2.33.0
|
40
|
+
|
3
41
|
## 2.32.1
|
4
42
|
|
5
43
|
### Patch Changes
|
@@ -106,20 +106,22 @@ const HTML_PARTIALS_EXTENSIONS = [
|
|
106
106
|
const FILE_SYSTEM_ROUTES_COMPONENTS_DIR = "internal_components";
|
107
107
|
const NESTED_ROUTE = {
|
108
108
|
LAYOUT_FILE: "layout",
|
109
|
+
LAYOUT_CONFIG_FILE: "layout.config",
|
109
110
|
LAYOUT_LOADER_FILE: "layout.loader",
|
110
111
|
LAYOUT_DATA_FILE: "layout.data",
|
111
112
|
LAYOUT_CLIENT_LOADER: "layout.data.client",
|
112
113
|
PAGE_FILE: "page",
|
114
|
+
PAGE_CONFIG_FILE: "page.config",
|
113
115
|
PAGE_LOADER_FILE: "page.loader",
|
114
|
-
PAGE_DATA_FILE: "
|
116
|
+
PAGE_DATA_FILE: "page.data",
|
115
117
|
PAGE_CLIENT_LOADER: "page.data.client",
|
116
|
-
LOADING_FILE: "loading",
|
117
|
-
ERROR_FILE: "error",
|
118
|
-
LOADER_FILE: "loader",
|
119
118
|
SPLATE_FILE: "$",
|
120
119
|
SPLATE_LOADER_FILE: "$.loader",
|
121
|
-
|
122
|
-
|
120
|
+
SPLATE_DATA_FILE: "$.data",
|
121
|
+
SPLATE_CLIENT_DATA: "$.data.client",
|
122
|
+
LOADING_FILE: "loading",
|
123
|
+
ERROR_FILE: "error",
|
124
|
+
LOADER_FILE: "loader"
|
123
125
|
};
|
124
126
|
const APP_CONFIG_NAME = "config";
|
125
127
|
const APP_INIT_EXPORTED = "init";
|
@@ -120,6 +120,8 @@ const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldVersion)
|
|
120
120
|
let pageLoaderFile = "";
|
121
121
|
let pageRoute = null;
|
122
122
|
let splatLoaderFile = "";
|
123
|
+
let splatClientData = "";
|
124
|
+
let splatData = "";
|
123
125
|
let splatRoute = null;
|
124
126
|
let pageConfigFile = "";
|
125
127
|
const items = await _utils.fs.readdir(dirname);
|
@@ -185,6 +187,12 @@ const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldVersion)
|
|
185
187
|
if (itemWithoutExt === _constants.NESTED_ROUTE.SPLATE_LOADER_FILE) {
|
186
188
|
splatLoaderFile = itemPath;
|
187
189
|
}
|
190
|
+
if (itemWithoutExt === _constants.NESTED_ROUTE.SPLATE_CLIENT_DATA) {
|
191
|
+
splatClientData = itemPath;
|
192
|
+
}
|
193
|
+
if (itemWithoutExt === _constants.NESTED_ROUTE.SPLATE_DATA_FILE) {
|
194
|
+
splatData = itemPath;
|
195
|
+
}
|
188
196
|
if (itemWithoutExt === _constants.NESTED_ROUTE.SPLATE_FILE) {
|
189
197
|
var _route_children2;
|
190
198
|
splatRoute = createRoute({
|
@@ -194,6 +202,12 @@ const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldVersion)
|
|
194
202
|
if (splatLoaderFile) {
|
195
203
|
splatRoute.loader = splatLoaderFile;
|
196
204
|
}
|
205
|
+
if (splatClientData) {
|
206
|
+
splatRoute.clientData = splatClientData;
|
207
|
+
}
|
208
|
+
if (splatData) {
|
209
|
+
splatRoute.data = splatData;
|
210
|
+
}
|
197
211
|
(_route_children2 = route.children) === null || _route_children2 === void 0 ? void 0 : _route_children2.push(splatRoute);
|
198
212
|
}
|
199
213
|
if (itemWithoutExt === _constants.NESTED_ROUTE.LOADING_FILE) {
|
@@ -27,20 +27,22 @@ export var HTML_PARTIALS_EXTENSIONS = [
|
|
27
27
|
export var FILE_SYSTEM_ROUTES_COMPONENTS_DIR = "internal_components";
|
28
28
|
export var NESTED_ROUTE = {
|
29
29
|
LAYOUT_FILE: "layout",
|
30
|
+
LAYOUT_CONFIG_FILE: "layout.config",
|
30
31
|
LAYOUT_LOADER_FILE: "layout.loader",
|
31
32
|
LAYOUT_DATA_FILE: "layout.data",
|
32
33
|
LAYOUT_CLIENT_LOADER: "layout.data.client",
|
33
34
|
PAGE_FILE: "page",
|
35
|
+
PAGE_CONFIG_FILE: "page.config",
|
34
36
|
PAGE_LOADER_FILE: "page.loader",
|
35
|
-
PAGE_DATA_FILE: "
|
37
|
+
PAGE_DATA_FILE: "page.data",
|
36
38
|
PAGE_CLIENT_LOADER: "page.data.client",
|
37
|
-
LOADING_FILE: "loading",
|
38
|
-
ERROR_FILE: "error",
|
39
|
-
LOADER_FILE: "loader",
|
40
39
|
SPLATE_FILE: "$",
|
41
40
|
SPLATE_LOADER_FILE: "$.loader",
|
42
|
-
|
43
|
-
|
41
|
+
SPLATE_DATA_FILE: "$.data",
|
42
|
+
SPLATE_CLIENT_DATA: "$.data.client",
|
43
|
+
LOADING_FILE: "loading",
|
44
|
+
ERROR_FILE: "error",
|
45
|
+
LOADER_FILE: "loader"
|
44
46
|
};
|
45
47
|
export var APP_CONFIG_NAME = "config";
|
46
48
|
export var APP_INIT_EXPORTED = "init";
|
@@ -73,7 +73,7 @@ export var optimizeRoute = function(routeTree) {
|
|
73
73
|
};
|
74
74
|
export var walk = function() {
|
75
75
|
var _ref = _async_to_generator(function(dirname, rootDir, alias, entryName, isMainEntry, oldVersion) {
|
76
|
-
var _routePath, _finalRoute_children, isDirectory, relativeDir, pathSegments, lastSegment, isRoot, isPathlessLayout, isWithoutLayoutPath, routePath, route, pageLoaderFile, pageRoute, splatLoaderFile, splatRoute, pageConfigFile, items, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, item, itemPath, extname, itemWithoutExt, isDirectory1, childRoute, _route_children, _route_children1, _route_children2, err, finalRoute, childRoutes, childRoute1, _$path, optimizedRoutes;
|
76
|
+
var _routePath, _finalRoute_children, isDirectory, relativeDir, pathSegments, lastSegment, isRoot, isPathlessLayout, isWithoutLayoutPath, routePath, route, pageLoaderFile, pageRoute, splatLoaderFile, splatClientData, splatData, splatRoute, pageConfigFile, items, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, item, itemPath, extname, itemWithoutExt, isDirectory1, childRoute, _route_children, _route_children1, _route_children2, err, finalRoute, childRoutes, childRoute1, _$path, optimizedRoutes;
|
77
77
|
return _ts_generator(this, function(_state) {
|
78
78
|
switch (_state.label) {
|
79
79
|
case 0:
|
@@ -119,6 +119,8 @@ export var walk = function() {
|
|
119
119
|
pageLoaderFile = "";
|
120
120
|
pageRoute = null;
|
121
121
|
splatLoaderFile = "";
|
122
|
+
splatClientData = "";
|
123
|
+
splatData = "";
|
122
124
|
splatRoute = null;
|
123
125
|
pageConfigFile = "";
|
124
126
|
return [
|
@@ -224,6 +226,12 @@ export var walk = function() {
|
|
224
226
|
if (itemWithoutExt === NESTED_ROUTE.SPLATE_LOADER_FILE) {
|
225
227
|
splatLoaderFile = itemPath;
|
226
228
|
}
|
229
|
+
if (itemWithoutExt === NESTED_ROUTE.SPLATE_CLIENT_DATA) {
|
230
|
+
splatClientData = itemPath;
|
231
|
+
}
|
232
|
+
if (itemWithoutExt === NESTED_ROUTE.SPLATE_DATA_FILE) {
|
233
|
+
splatData = itemPath;
|
234
|
+
}
|
227
235
|
if (itemWithoutExt === NESTED_ROUTE.SPLATE_FILE) {
|
228
236
|
;
|
229
237
|
splatRoute = createRoute({
|
@@ -233,6 +241,12 @@ export var walk = function() {
|
|
233
241
|
if (splatLoaderFile) {
|
234
242
|
splatRoute.loader = splatLoaderFile;
|
235
243
|
}
|
244
|
+
if (splatClientData) {
|
245
|
+
splatRoute.clientData = splatClientData;
|
246
|
+
}
|
247
|
+
if (splatData) {
|
248
|
+
splatRoute.data = splatData;
|
249
|
+
}
|
236
250
|
(_route_children2 = route.children) === null || _route_children2 === void 0 ? void 0 : _route_children2.push(splatRoute);
|
237
251
|
}
|
238
252
|
if (itemWithoutExt === NESTED_ROUTE.LOADING_FILE) {
|
@@ -27,20 +27,22 @@ export const HTML_PARTIALS_EXTENSIONS = [
|
|
27
27
|
export const FILE_SYSTEM_ROUTES_COMPONENTS_DIR = "internal_components";
|
28
28
|
export const NESTED_ROUTE = {
|
29
29
|
LAYOUT_FILE: "layout",
|
30
|
+
LAYOUT_CONFIG_FILE: "layout.config",
|
30
31
|
LAYOUT_LOADER_FILE: "layout.loader",
|
31
32
|
LAYOUT_DATA_FILE: "layout.data",
|
32
33
|
LAYOUT_CLIENT_LOADER: "layout.data.client",
|
33
34
|
PAGE_FILE: "page",
|
35
|
+
PAGE_CONFIG_FILE: "page.config",
|
34
36
|
PAGE_LOADER_FILE: "page.loader",
|
35
|
-
PAGE_DATA_FILE: "
|
37
|
+
PAGE_DATA_FILE: "page.data",
|
36
38
|
PAGE_CLIENT_LOADER: "page.data.client",
|
37
|
-
LOADING_FILE: "loading",
|
38
|
-
ERROR_FILE: "error",
|
39
|
-
LOADER_FILE: "loader",
|
40
39
|
SPLATE_FILE: "$",
|
41
40
|
SPLATE_LOADER_FILE: "$.loader",
|
42
|
-
|
43
|
-
|
41
|
+
SPLATE_DATA_FILE: "$.data",
|
42
|
+
SPLATE_CLIENT_DATA: "$.data.client",
|
43
|
+
LOADING_FILE: "loading",
|
44
|
+
ERROR_FILE: "error",
|
45
|
+
LOADER_FILE: "loader"
|
44
46
|
};
|
45
47
|
export const APP_CONFIG_NAME = "config";
|
46
48
|
export const APP_INIT_EXPORTED = "init";
|
@@ -97,6 +97,8 @@ export const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldV
|
|
97
97
|
let pageLoaderFile = "";
|
98
98
|
let pageRoute = null;
|
99
99
|
let splatLoaderFile = "";
|
100
|
+
let splatClientData = "";
|
101
|
+
let splatData = "";
|
100
102
|
let splatRoute = null;
|
101
103
|
let pageConfigFile = "";
|
102
104
|
const items = await fs.readdir(dirname);
|
@@ -162,6 +164,12 @@ export const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldV
|
|
162
164
|
if (itemWithoutExt === NESTED_ROUTE.SPLATE_LOADER_FILE) {
|
163
165
|
splatLoaderFile = itemPath;
|
164
166
|
}
|
167
|
+
if (itemWithoutExt === NESTED_ROUTE.SPLATE_CLIENT_DATA) {
|
168
|
+
splatClientData = itemPath;
|
169
|
+
}
|
170
|
+
if (itemWithoutExt === NESTED_ROUTE.SPLATE_DATA_FILE) {
|
171
|
+
splatData = itemPath;
|
172
|
+
}
|
165
173
|
if (itemWithoutExt === NESTED_ROUTE.SPLATE_FILE) {
|
166
174
|
var _route_children2;
|
167
175
|
splatRoute = createRoute({
|
@@ -171,6 +179,12 @@ export const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldV
|
|
171
179
|
if (splatLoaderFile) {
|
172
180
|
splatRoute.loader = splatLoaderFile;
|
173
181
|
}
|
182
|
+
if (splatClientData) {
|
183
|
+
splatRoute.clientData = splatClientData;
|
184
|
+
}
|
185
|
+
if (splatData) {
|
186
|
+
splatRoute.data = splatData;
|
187
|
+
}
|
174
188
|
(_route_children2 = route.children) === null || _route_children2 === void 0 ? void 0 : _route_children2.push(splatRoute);
|
175
189
|
}
|
176
190
|
if (itemWithoutExt === NESTED_ROUTE.LOADING_FILE) {
|
@@ -18,20 +18,22 @@ export declare const HTML_PARTIALS_EXTENSIONS: string[];
|
|
18
18
|
export declare const FILE_SYSTEM_ROUTES_COMPONENTS_DIR = "internal_components";
|
19
19
|
export declare const NESTED_ROUTE: {
|
20
20
|
LAYOUT_FILE: string;
|
21
|
+
LAYOUT_CONFIG_FILE: string;
|
21
22
|
LAYOUT_LOADER_FILE: string;
|
22
23
|
LAYOUT_DATA_FILE: string;
|
23
24
|
LAYOUT_CLIENT_LOADER: string;
|
24
25
|
PAGE_FILE: string;
|
26
|
+
PAGE_CONFIG_FILE: string;
|
25
27
|
PAGE_LOADER_FILE: string;
|
26
28
|
PAGE_DATA_FILE: string;
|
27
29
|
PAGE_CLIENT_LOADER: string;
|
30
|
+
SPLATE_FILE: string;
|
31
|
+
SPLATE_LOADER_FILE: string;
|
32
|
+
SPLATE_DATA_FILE: string;
|
33
|
+
SPLATE_CLIENT_DATA: string;
|
28
34
|
LOADING_FILE: string;
|
29
35
|
ERROR_FILE: string;
|
30
36
|
LOADER_FILE: string;
|
31
|
-
SPLATE_FILE: string;
|
32
|
-
SPLATE_LOADER_FILE: string;
|
33
|
-
LAYOUT_CONFIG_FILE: string;
|
34
|
-
PAGE_CONFIG_FILE: string;
|
35
37
|
};
|
36
38
|
export declare const APP_CONFIG_NAME = "config";
|
37
39
|
export declare const APP_INIT_EXPORTED = "init";
|
@@ -53,10 +53,8 @@ export interface SharedSourceConfig extends BuilderSharedSourceConfig {
|
|
53
53
|
*/
|
54
54
|
configDir?: string;
|
55
55
|
/**
|
56
|
-
*
|
57
|
-
*
|
58
|
-
* The configuration of `source.designSystem` is provided by `tailwindcss` plugin.
|
59
|
-
* Please use `yarn new` or `pnpm new` to enable the corresponding capability.
|
56
|
+
* @deprecated designSystem is no longer required.
|
57
|
+
* If you are using Tailwind CSS, you can now use the `theme` option of Tailwind CSS, they are the same.
|
60
58
|
*/
|
61
59
|
designSystem?: Record<string, any>;
|
62
60
|
}
|
@@ -17,9 +17,8 @@ export type SourceLegacyUserConfig = {
|
|
17
17
|
moduleScopes?: Array<string | RegExp> | (((scopes: Array<string | RegExp>) => void) | ((scopes: Array<string | RegExp>) => Array<string | RegExp>))[] | ((scopes: Array<string | RegExp>) => Array<string | RegExp>) | ((scopes: Array<string | RegExp>) => void);
|
18
18
|
include?: Array<string | RegExp>;
|
19
19
|
/**
|
20
|
-
*
|
21
|
-
*
|
22
|
-
* @requires `tailwindcss` plugin
|
20
|
+
* @deprecated designSystem is no longer required.
|
21
|
+
* If you are using Tailwind CSS, you can now use the `theme` option of Tailwind CSS, they are the same.
|
23
22
|
*/
|
24
23
|
designSystem?: Record<string, any>;
|
25
24
|
};
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.
|
18
|
+
"version": "2.33.0",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -73,24 +73,24 @@
|
|
73
73
|
"esbuild": "0.17.19",
|
74
74
|
"rspack-plugin-virtual-module": "0.1.7",
|
75
75
|
"@swc/helpers": "0.5.1",
|
76
|
-
"@modern-js/builder": "2.
|
77
|
-
"@modern-js/builder-plugin-esbuild": "2.
|
78
|
-
"@modern-js/builder-plugin-node-polyfill": "2.
|
79
|
-
"@modern-js/builder-shared": "2.
|
80
|
-
"@modern-js/builder-webpack-provider": "2.
|
81
|
-
"@modern-js/core": "2.
|
82
|
-
"@modern-js/new-action": "2.
|
83
|
-
"@modern-js/node-bundle-require": "2.
|
84
|
-
"@modern-js/plugin": "2.
|
85
|
-
"@modern-js/plugin-data-loader": "2.
|
86
|
-
"@modern-js/plugin-i18n": "2.
|
87
|
-
"@modern-js/plugin-lint": "2.
|
88
|
-
"@modern-js/prod-server": "2.
|
89
|
-
"@modern-js/server": "2.
|
90
|
-
"@modern-js/types": "2.
|
91
|
-
"@modern-js/upgrade": "2.
|
92
|
-
"@modern-js/utils": "2.
|
93
|
-
"@modern-js/server-core": "2.
|
76
|
+
"@modern-js/builder": "2.33.0",
|
77
|
+
"@modern-js/builder-plugin-esbuild": "2.33.0",
|
78
|
+
"@modern-js/builder-plugin-node-polyfill": "2.33.0",
|
79
|
+
"@modern-js/builder-shared": "2.33.0",
|
80
|
+
"@modern-js/builder-webpack-provider": "2.33.0",
|
81
|
+
"@modern-js/core": "2.33.0",
|
82
|
+
"@modern-js/new-action": "2.33.0",
|
83
|
+
"@modern-js/node-bundle-require": "2.33.0",
|
84
|
+
"@modern-js/plugin": "2.33.0",
|
85
|
+
"@modern-js/plugin-data-loader": "2.33.0",
|
86
|
+
"@modern-js/plugin-i18n": "2.33.0",
|
87
|
+
"@modern-js/plugin-lint": "2.33.0",
|
88
|
+
"@modern-js/prod-server": "2.33.0",
|
89
|
+
"@modern-js/server": "2.33.0",
|
90
|
+
"@modern-js/types": "2.33.0",
|
91
|
+
"@modern-js/upgrade": "2.33.0",
|
92
|
+
"@modern-js/utils": "2.33.0",
|
93
|
+
"@modern-js/server-core": "2.33.0"
|
94
94
|
},
|
95
95
|
"devDependencies": {
|
96
96
|
"@types/babel__traverse": "^7.14.2",
|
@@ -99,13 +99,13 @@
|
|
99
99
|
"jest": "^29",
|
100
100
|
"typescript": "^5",
|
101
101
|
"webpack": "^5.88.1",
|
102
|
-
"@modern-js/builder-plugin-swc": "2.
|
103
|
-
"@modern-js/builder-rspack-provider": "2.
|
104
|
-
"@scripts/build": "2.
|
105
|
-
"@scripts/jest-config": "2.
|
102
|
+
"@modern-js/builder-plugin-swc": "2.33.0",
|
103
|
+
"@modern-js/builder-rspack-provider": "2.33.0",
|
104
|
+
"@scripts/build": "2.33.0",
|
105
|
+
"@scripts/jest-config": "2.33.0"
|
106
106
|
},
|
107
107
|
"peerDependencies": {
|
108
|
-
"@modern-js/builder-rspack-provider": "^2.
|
108
|
+
"@modern-js/builder-rspack-provider": "^2.33.0"
|
109
109
|
},
|
110
110
|
"peerDependenciesMeta": {
|
111
111
|
"@modern-js/builder-rspack-provider": {
|