@modern-js/app-tools 2.60.4-alpha.2 → 2.60.4

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.
@@ -145,7 +145,10 @@ const collectStaticRoutes = (appContext, config) => {
145
145
  const { appDirectory } = appContext;
146
146
  const { source: { configDir }, server: { publicRoutes = {} } } = config;
147
147
  const publicFolder = import_path.default.resolve(appDirectory, configDir || "", "public");
148
- return import_fs.default.existsSync(publicFolder) ? (0, import_utils2.walkDirectory)(publicFolder).map((filePath) => {
148
+ const ignoreFiles = [
149
+ ".gitkeep"
150
+ ];
151
+ return import_fs.default.existsSync(publicFolder) ? (0, import_utils2.walkDirectory)(publicFolder).filter((filePath) => !ignoreFiles.includes(import_path.default.basename(filePath))).map((filePath) => {
149
152
  const urlPath = `${(0, import_utils.urlJoin)(toPosix(filePath).slice(toPosix(publicFolder).length))}`;
150
153
  return {
151
154
  urlPath: publicRoutes[(0, import_utils.removeLeadingSlash)(urlPath)] || urlPath,
@@ -104,7 +104,9 @@ const registerCompiler = async (appDir, distDir, alias) => {
104
104
  ...tsNodeOptions
105
105
  });
106
106
  } catch (error) {
107
- import_utils.logger.error(error);
107
+ if (process.env.DEBUG) {
108
+ import_utils.logger.error(error);
109
+ }
108
110
  await registerEsbuild({
109
111
  isTsProject,
110
112
  tsConfig,
@@ -110,7 +110,12 @@ var collectStaticRoutes = function(appContext, config) {
110
110
  var appDirectory = appContext.appDirectory;
111
111
  var configDir = config.source.configDir, _config_server = config.server, _config_server_publicRoutes = _config_server.publicRoutes, publicRoutes = _config_server_publicRoutes === void 0 ? {} : _config_server_publicRoutes;
112
112
  var publicFolder = path.resolve(appDirectory, configDir || "", "public");
113
- return fs.existsSync(publicFolder) ? walkDirectory(publicFolder).map(function(filePath) {
113
+ var ignoreFiles = [
114
+ ".gitkeep"
115
+ ];
116
+ return fs.existsSync(publicFolder) ? walkDirectory(publicFolder).filter(function(filePath) {
117
+ return !ignoreFiles.includes(path.basename(filePath));
118
+ }).map(function(filePath) {
114
119
  var urlPath = "".concat(urlJoin(toPosix(filePath).slice(toPosix(publicFolder).length)));
115
120
  return {
116
121
  urlPath: publicRoutes[removeLeadingSlash(urlPath)] || urlPath,
@@ -132,7 +132,9 @@ var registerCompiler = function() {
132
132
  ];
133
133
  case 5:
134
134
  error = _state.sent();
135
- logger.error(error);
135
+ if (process.env.DEBUG) {
136
+ logger.error(error);
137
+ }
136
138
  return [
137
139
  4,
138
140
  registerEsbuild({
@@ -112,7 +112,10 @@ const collectStaticRoutes = (appContext, config) => {
112
112
  const { appDirectory } = appContext;
113
113
  const { source: { configDir }, server: { publicRoutes = {} } } = config;
114
114
  const publicFolder = path.resolve(appDirectory, configDir || "", "public");
115
- return fs.existsSync(publicFolder) ? walkDirectory(publicFolder).map((filePath) => {
115
+ const ignoreFiles = [
116
+ ".gitkeep"
117
+ ];
118
+ return fs.existsSync(publicFolder) ? walkDirectory(publicFolder).filter((filePath) => !ignoreFiles.includes(path.basename(filePath))).map((filePath) => {
116
119
  const urlPath = `${urlJoin(toPosix(filePath).slice(toPosix(publicFolder).length))}`;
117
120
  return {
118
121
  urlPath: publicRoutes[removeLeadingSlash(urlPath)] || urlPath,
@@ -71,7 +71,9 @@ const registerCompiler = async (appDir, distDir, alias) => {
71
71
  ...tsNodeOptions
72
72
  });
73
73
  } catch (error) {
74
- logger.error(error);
74
+ if (process.env.DEBUG) {
75
+ logger.error(error);
76
+ }
75
77
  await registerEsbuild({
76
78
  isTsProject,
77
79
  tsConfig,
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.60.4-alpha.2",
18
+ "version": "2.60.4",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -88,19 +88,19 @@
88
88
  "mlly": "^1.6.1",
89
89
  "pkg-types": "^1.1.0",
90
90
  "std-env": "^3.7.0",
91
- "@modern-js/node-bundle-require": "2.60.3",
92
- "@modern-js/plugin-data-loader": "2.60.3",
93
- "@modern-js/core": "2.60.3",
94
- "@modern-js/plugin": "2.60.3",
95
- "@modern-js/plugin-i18n": "2.60.3",
96
- "@modern-js/prod-server": "2.60.3",
97
- "@modern-js/server-core": "2.60.3",
98
- "@modern-js/types": "2.60.3",
99
- "@modern-js/server": "2.60.3",
100
- "@modern-js/rsbuild-plugin-esbuild": "2.60.3",
101
- "@modern-js/server-utils": "2.60.3",
102
- "@modern-js/utils": "2.60.3",
103
- "@modern-js/uni-builder": "2.60.3"
91
+ "@modern-js/core": "2.60.4",
92
+ "@modern-js/plugin": "2.60.4",
93
+ "@modern-js/plugin-data-loader": "2.60.4",
94
+ "@modern-js/node-bundle-require": "2.60.4",
95
+ "@modern-js/prod-server": "2.60.4",
96
+ "@modern-js/rsbuild-plugin-esbuild": "2.60.4",
97
+ "@modern-js/plugin-i18n": "2.60.4",
98
+ "@modern-js/server": "2.60.4",
99
+ "@modern-js/server-utils": "2.60.4",
100
+ "@modern-js/types": "2.60.4",
101
+ "@modern-js/server-core": "2.60.4",
102
+ "@modern-js/uni-builder": "2.60.4",
103
+ "@modern-js/utils": "2.60.4"
104
104
  },
105
105
  "devDependencies": {
106
106
  "@rsbuild/plugin-webpack-swc": "~1.0.3",
@@ -112,8 +112,8 @@
112
112
  "tsconfig-paths": "^4.2.0",
113
113
  "typescript": "^5",
114
114
  "webpack": "^5.95.0",
115
- "@scripts/build": "2.60.3",
116
- "@scripts/jest-config": "2.60.3"
115
+ "@scripts/build": "2.60.4",
116
+ "@scripts/jest-config": "2.60.4"
117
117
  },
118
118
  "peerDependencies": {
119
119
  "ts-node": "^10.7.0",