@modern-js/app-tools 2.2.1-alpha.0 → 2.3.1-alpha.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/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # @modern-js/app-tools
2
2
 
3
+ ## 2.3.0
4
+
5
+ ### Patch Changes
6
+
7
+ - fd5a3ed: fix: failed to exit new command
8
+
9
+ fix: 修复 new 命令执行完成后未退出进程的问题
10
+
11
+ - Updated dependencies [65f1322]
12
+ - Updated dependencies [7cd8185]
13
+ - Updated dependencies [fd5a3ed]
14
+ - Updated dependencies [362c9a8]
15
+ - Updated dependencies [67ba34a]
16
+ - Updated dependencies [2ad9fdf]
17
+ - Updated dependencies [7b2cdcb]
18
+ - Updated dependencies [1b0dd35]
19
+ - Updated dependencies [f9a26fe]
20
+ - Updated dependencies [6ca1c0b]
21
+ - Updated dependencies [89b6739]
22
+ - Updated dependencies [01e4a27]
23
+ - Updated dependencies [7736171]
24
+ - Updated dependencies [ff48fc2]
25
+ - Updated dependencies [b6c2eb8]
26
+ - Updated dependencies [3cdf48e]
27
+ - @modern-js/core@2.3.0
28
+ - @modern-js/builder@2.3.0
29
+ - @modern-js/builder-webpack-provider@2.3.0
30
+ - @modern-js/utils@2.3.0
31
+ - @modern-js/builder-shared@2.3.0
32
+ - @modern-js/server@2.3.0
33
+ - @modern-js/plugin-data-loader@2.3.0
34
+ - @modern-js/plugin-lint@2.3.0
35
+ - @modern-js/builder-plugin-esbuild@2.3.0
36
+ - @modern-js/builder-plugin-node-polyfill@2.3.0
37
+ - @modern-js/plugin-i18n@2.3.0
38
+ - @modern-js/new-action@2.3.0
39
+ - @modern-js/prod-server@2.3.0
40
+ - @modern-js/node-bundle-require@2.3.0
41
+ - @modern-js/upgrade@2.3.0
42
+ - @modern-js/plugin@2.3.0
43
+ - @modern-js/types@2.3.0
44
+
3
45
  ## 2.2.0
4
46
 
5
47
  ### Minor Changes
@@ -24,7 +24,8 @@ const NESTED_ROUTE = {
24
24
  LOADING_FILE: "loading",
25
25
  ERROR_FILE: "error",
26
26
  LOADER_FILE: "loader",
27
- SPLATE_FILE: "$"
27
+ SPLATE_FILE: "$",
28
+ SPLATE_LOADER_FILE: "$.loader"
28
29
  };
29
30
  const APP_CONFIG_NAME = "config";
30
31
  const APP_INIT_EXPORTED = "init";
@@ -90,6 +90,8 @@ const walk = (dirname, rootDir, alias, entryName) => __async(void 0, null, funct
90
90
  };
91
91
  let pageLoaderFile = "";
92
92
  let pageRoute = null;
93
+ let splatLoaderFile = "";
94
+ let splatRoute = null;
93
95
  const items = yield fs.readdir(dirname);
94
96
  for (const item of items) {
95
97
  const itemPath = path.join(dirname, item);
@@ -130,8 +132,11 @@ const walk = (dirname, rootDir, alias, entryName) => __async(void 0, null, funct
130
132
  }
131
133
  (_b = route.children) == null ? void 0 : _b.push(pageRoute);
132
134
  }
135
+ if (itemWithoutExt === NESTED_ROUTE.SPLATE_LOADER_FILE) {
136
+ splatLoaderFile = itemPath;
137
+ }
133
138
  if (itemWithoutExt === NESTED_ROUTE.SPLATE_FILE) {
134
- const splatRoute = createRoute(
139
+ splatRoute = createRoute(
135
140
  {
136
141
  _component: replaceWithAlias(alias.basename, itemPath, alias.name),
137
142
  path: "*"
@@ -140,6 +145,9 @@ const walk = (dirname, rootDir, alias, entryName) => __async(void 0, null, funct
140
145
  itemPath,
141
146
  entryName
142
147
  );
148
+ if (splatLoaderFile) {
149
+ splatRoute.loader = splatLoaderFile;
150
+ }
143
151
  (_c = route.children) == null ? void 0 : _c.push(splatRoute);
144
152
  }
145
153
  if (itemWithoutExt === NESTED_ROUTE.LOADING_FILE) {
@@ -67,7 +67,8 @@ const NESTED_ROUTE = {
67
67
  LOADING_FILE: "loading",
68
68
  ERROR_FILE: "error",
69
69
  LOADER_FILE: "loader",
70
- SPLATE_FILE: "$"
70
+ SPLATE_FILE: "$",
71
+ SPLATE_LOADER_FILE: "$.loader"
71
72
  };
72
73
  const APP_CONFIG_NAME = "config";
73
74
  const APP_INIT_EXPORTED = "init";
@@ -116,6 +116,8 @@ const walk = (dirname, rootDir, alias, entryName) => __async(void 0, null, funct
116
116
  };
117
117
  let pageLoaderFile = "";
118
118
  let pageRoute = null;
119
+ let splatLoaderFile = "";
120
+ let splatRoute = null;
119
121
  const items = yield import_utils.fs.readdir(dirname);
120
122
  for (const item of items) {
121
123
  const itemPath = path.join(dirname, item);
@@ -156,8 +158,11 @@ const walk = (dirname, rootDir, alias, entryName) => __async(void 0, null, funct
156
158
  }
157
159
  (_b = route.children) == null ? void 0 : _b.push(pageRoute);
158
160
  }
161
+ if (itemWithoutExt === import_constants.NESTED_ROUTE.SPLATE_LOADER_FILE) {
162
+ splatLoaderFile = itemPath;
163
+ }
159
164
  if (itemWithoutExt === import_constants.NESTED_ROUTE.SPLATE_FILE) {
160
- const splatRoute = createRoute(
165
+ splatRoute = createRoute(
161
166
  {
162
167
  _component: (0, import_utils2.replaceWithAlias)(alias.basename, itemPath, alias.name),
163
168
  path: "*"
@@ -166,6 +171,9 @@ const walk = (dirname, rootDir, alias, entryName) => __async(void 0, null, funct
166
171
  itemPath,
167
172
  entryName
168
173
  );
174
+ if (splatLoaderFile) {
175
+ splatRoute.loader = splatLoaderFile;
176
+ }
169
177
  (_c = route.children) == null ? void 0 : _c.push(splatRoute);
170
178
  }
171
179
  if (itemWithoutExt === import_constants.NESTED_ROUTE.LOADING_FILE) {
@@ -33,7 +33,8 @@ var NESTED_ROUTE = {
33
33
  LOADING_FILE: "loading",
34
34
  ERROR_FILE: "error",
35
35
  LOADER_FILE: "loader",
36
- SPLATE_FILE: "$"
36
+ SPLATE_FILE: "$",
37
+ SPLATE_LOADER_FILE: "$.loader"
37
38
  };
38
39
  var APP_CONFIG_NAME = "config";
39
40
  var APP_INIT_EXPORTED = "init";
@@ -197,7 +197,7 @@ var createRoute = function(routeInfo, rootDir, filename, entryName) {
197
197
  };
198
198
  var walk = function() {
199
199
  var _ref = _asyncToGenerator(function(dirname, rootDir, alias, entryName) {
200
- var ref, isDirectory, relativeDir, pathSegments, lastSegment, isRoot, isPathlessLayout, isWithoutLayoutPath, routePath, route, pageLoaderFile, pageRoute, items, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, item, itemPath, extname, itemWithoutExt, isDirectory2, childRoute, ref1, ref2, ref3, splatRoute, err, finalRoute;
200
+ var ref, isDirectory, relativeDir, pathSegments, lastSegment, isRoot, isPathlessLayout, isWithoutLayoutPath, routePath, route, pageLoaderFile, pageRoute, splatLoaderFile, splatRoute, items, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, item, itemPath, extname, itemWithoutExt, isDirectory2, childRoute, ref1, ref2, ref3, err, finalRoute;
201
201
  return __generator(this, function(_state) {
202
202
  switch(_state.label){
203
203
  case 0:
@@ -242,6 +242,8 @@ var walk = function() {
242
242
  };
243
243
  pageLoaderFile = "";
244
244
  pageRoute = null;
245
+ splatLoaderFile = "";
246
+ splatRoute = null;
245
247
  return [
246
248
  4,
247
249
  fs.readdir(dirname)
@@ -317,12 +319,18 @@ var walk = function() {
317
319
  }
318
320
  (ref2 = route.children) === null || ref2 === void 0 ? void 0 : ref2.push(pageRoute);
319
321
  }
322
+ if (itemWithoutExt === NESTED_ROUTE.SPLATE_LOADER_FILE) {
323
+ splatLoaderFile = itemPath;
324
+ }
320
325
  if (itemWithoutExt === NESTED_ROUTE.SPLATE_FILE) {
321
326
  ;
322
327
  splatRoute = createRoute({
323
328
  _component: replaceWithAlias(alias.basename, itemPath, alias.name),
324
329
  path: "*"
325
330
  }, rootDir, itemPath, entryName);
331
+ if (splatLoaderFile) {
332
+ splatRoute.loader = splatLoaderFile;
333
+ }
326
334
  (ref3 = route.children) === null || ref3 === void 0 ? void 0 : ref3.push(splatRoute);
327
335
  }
328
336
  if (itemWithoutExt === NESTED_ROUTE.LOADING_FILE) {
@@ -25,6 +25,7 @@ export declare const NESTED_ROUTE: {
25
25
  ERROR_FILE: string;
26
26
  LOADER_FILE: string;
27
27
  SPLATE_FILE: string;
28
+ SPLATE_LOADER_FILE: string;
28
29
  };
29
30
  export declare const APP_CONFIG_NAME = "config";
30
31
  export declare const APP_INIT_EXPORTED = "init";
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.2.1-alpha.0",
14
+ "version": "2.3.1-alpha.1",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -63,31 +63,31 @@
63
63
  "@babel/runtime": "^7.18.0",
64
64
  "@babel/traverse": "^7.18.0",
65
65
  "@babel/types": "^7.18.0",
66
- "@modern-js/builder": "2.2.0",
67
- "@modern-js/builder-plugin-esbuild": "2.2.0",
68
- "@modern-js/builder-plugin-node-polyfill": "2.2.0",
69
- "@modern-js/builder-shared": "2.2.0",
70
- "@modern-js/builder-webpack-provider": "2.2.0",
71
- "@modern-js/core": "2.2.0",
72
- "@modern-js/new-action": "2.2.0",
73
- "@modern-js/node-bundle-require": "2.2.0",
74
- "@modern-js/plugin": "2.2.0",
75
- "@modern-js/plugin-data-loader": "2.2.0",
76
- "@modern-js/plugin-i18n": "2.2.0",
77
- "@modern-js/plugin-lint": "2.2.0",
78
- "@modern-js/prod-server": "2.2.0",
79
- "@modern-js/server": "2.2.0",
80
- "@modern-js/types": "2.2.0",
81
- "@modern-js/upgrade": "2.2.0",
82
- "@modern-js/utils": "2.2.0",
66
+ "@modern-js/builder": "2.3.0",
67
+ "@modern-js/builder-plugin-esbuild": "2.3.0",
68
+ "@modern-js/builder-plugin-node-polyfill": "2.3.0",
69
+ "@modern-js/builder-shared": "2.3.0",
70
+ "@modern-js/builder-webpack-provider": "2.3.0",
71
+ "@modern-js/core": "2.3.0",
72
+ "@modern-js/new-action": "2.3.0",
73
+ "@modern-js/node-bundle-require": "2.3.0",
74
+ "@modern-js/plugin": "2.3.0",
75
+ "@modern-js/plugin-data-loader": "2.3.0",
76
+ "@modern-js/plugin-i18n": "2.3.0",
77
+ "@modern-js/plugin-lint": "2.3.0",
78
+ "@modern-js/prod-server": "2.3.0",
79
+ "@modern-js/server": "2.3.0",
80
+ "@modern-js/types": "2.3.0",
81
+ "@modern-js/upgrade": "2.3.0",
82
+ "@modern-js/utils": "2.3.0",
83
83
  "es-module-lexer": "^1.1.0",
84
84
  "esbuild": "0.15.7"
85
85
  },
86
86
  "devDependencies": {
87
- "@modern-js/builder-plugin-swc": "2.2.0",
88
- "@modern-js/server-core": "2.2.0",
89
- "@scripts/build": "2.2.0",
90
- "@scripts/jest-config": "2.2.0",
87
+ "@modern-js/builder-plugin-swc": "2.3.0",
88
+ "@modern-js/server-core": "2.3.0",
89
+ "@scripts/build": "2.3.0",
90
+ "@scripts/jest-config": "2.3.0",
91
91
  "@types/babel__traverse": "^7.14.2",
92
92
  "@types/jest": "^27",
93
93
  "@types/node": "^14",