@bleedingdev/modern-js-app-tools 3.2.0-ultramodern.92 → 3.2.0-ultramodern.94
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.
|
@@ -66,13 +66,26 @@ function resolvePackageEntry(packageName, paths) {
|
|
|
66
66
|
}
|
|
67
67
|
function resolvePackageFile(packageName, filePath, paths) {
|
|
68
68
|
try {
|
|
69
|
-
|
|
69
|
+
return external_node_fs_default().realpathSync(require.resolve(`${packageName}/${filePath}`, {
|
|
70
70
|
paths
|
|
71
|
-
});
|
|
72
|
-
const packageFile = external_node_path_default().join(external_node_path_default().dirname(packageJsonPath), filePath);
|
|
73
|
-
return external_node_fs_default().existsSync(packageFile) ? external_node_fs_default().realpathSync(packageFile) : void 0;
|
|
71
|
+
}));
|
|
74
72
|
} catch {
|
|
75
|
-
|
|
73
|
+
const packageEntry = resolvePackageEntry(packageName, paths);
|
|
74
|
+
if (!packageEntry) return;
|
|
75
|
+
const packageRoot = findPackageRoot(packageEntry, packageName);
|
|
76
|
+
const packageFile = packageRoot ? external_node_path_default().join(packageRoot, filePath) : void 0;
|
|
77
|
+
return packageFile && external_node_fs_default().existsSync(packageFile) ? external_node_fs_default().realpathSync(packageFile) : void 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function findPackageRoot(entryFile, packageName) {
|
|
81
|
+
let directory = external_node_path_default().dirname(entryFile);
|
|
82
|
+
while(directory !== external_node_path_default().dirname(directory)){
|
|
83
|
+
const packageJsonPath = external_node_path_default().join(directory, 'package.json');
|
|
84
|
+
try {
|
|
85
|
+
const packageJson = JSON.parse(external_node_fs_default().readFileSync(packageJsonPath, 'utf-8'));
|
|
86
|
+
if (packageJson.name === packageName) return directory;
|
|
87
|
+
} catch {}
|
|
88
|
+
directory = external_node_path_default().dirname(directory);
|
|
76
89
|
}
|
|
77
90
|
}
|
|
78
91
|
function setAliasIfPresent(alias, name, value) {
|
|
@@ -170,7 +183,7 @@ function getBuilderEnvironments(normalizedConfig, appContext, tempBuilderConfig)
|
|
|
170
183
|
appContext.appDirectory,
|
|
171
184
|
process.cwd()
|
|
172
185
|
]) : void 0;
|
|
173
|
-
const loadableComponentFile = useCloudflareModuleWorker ?
|
|
186
|
+
const loadableComponentFile = useCloudflareModuleWorker ? resolvePackageFile('@loadable/component', 'dist/esm/loadable.esm.mjs', [
|
|
174
187
|
appContext.appDirectory,
|
|
175
188
|
process.cwd(),
|
|
176
189
|
CLOUDFLARE_WORKER_COMPAT_TEMPLATE_DIR
|
|
@@ -27,13 +27,26 @@ function resolvePackageEntry(packageName, paths) {
|
|
|
27
27
|
}
|
|
28
28
|
function resolvePackageFile(packageName, filePath, paths) {
|
|
29
29
|
try {
|
|
30
|
-
|
|
30
|
+
return node_fs.realpathSync(require.resolve(`${packageName}/${filePath}`, {
|
|
31
31
|
paths
|
|
32
|
-
});
|
|
33
|
-
const packageFile = node_path.join(node_path.dirname(packageJsonPath), filePath);
|
|
34
|
-
return node_fs.existsSync(packageFile) ? node_fs.realpathSync(packageFile) : void 0;
|
|
32
|
+
}));
|
|
35
33
|
} catch {
|
|
36
|
-
|
|
34
|
+
const packageEntry = resolvePackageEntry(packageName, paths);
|
|
35
|
+
if (!packageEntry) return;
|
|
36
|
+
const packageRoot = findPackageRoot(packageEntry, packageName);
|
|
37
|
+
const packageFile = packageRoot ? node_path.join(packageRoot, filePath) : void 0;
|
|
38
|
+
return packageFile && node_fs.existsSync(packageFile) ? node_fs.realpathSync(packageFile) : void 0;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function findPackageRoot(entryFile, packageName) {
|
|
42
|
+
let directory = node_path.dirname(entryFile);
|
|
43
|
+
while(directory !== node_path.dirname(directory)){
|
|
44
|
+
const packageJsonPath = node_path.join(directory, 'package.json');
|
|
45
|
+
try {
|
|
46
|
+
const packageJson = JSON.parse(node_fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
47
|
+
if (packageJson.name === packageName) return directory;
|
|
48
|
+
} catch {}
|
|
49
|
+
directory = node_path.dirname(directory);
|
|
37
50
|
}
|
|
38
51
|
}
|
|
39
52
|
function setAliasIfPresent(alias, name, value) {
|
|
@@ -131,7 +144,7 @@ function getBuilderEnvironments(normalizedConfig, appContext, tempBuilderConfig)
|
|
|
131
144
|
appContext.appDirectory,
|
|
132
145
|
process.cwd()
|
|
133
146
|
]) : void 0;
|
|
134
|
-
const loadableComponentFile = useCloudflareModuleWorker ?
|
|
147
|
+
const loadableComponentFile = useCloudflareModuleWorker ? resolvePackageFile('@loadable/component', 'dist/esm/loadable.esm.mjs', [
|
|
135
148
|
appContext.appDirectory,
|
|
136
149
|
process.cwd(),
|
|
137
150
|
CLOUDFLARE_WORKER_COMPAT_TEMPLATE_DIR
|
|
@@ -32,13 +32,26 @@ function resolvePackageEntry(packageName, paths) {
|
|
|
32
32
|
}
|
|
33
33
|
function resolvePackageFile(packageName, filePath, paths) {
|
|
34
34
|
try {
|
|
35
|
-
|
|
35
|
+
return node_fs.realpathSync(require.resolve(`${packageName}/${filePath}`, {
|
|
36
36
|
paths
|
|
37
|
-
});
|
|
38
|
-
const packageFile = node_path.join(node_path.dirname(packageJsonPath), filePath);
|
|
39
|
-
return node_fs.existsSync(packageFile) ? node_fs.realpathSync(packageFile) : void 0;
|
|
37
|
+
}));
|
|
40
38
|
} catch {
|
|
41
|
-
|
|
39
|
+
const packageEntry = resolvePackageEntry(packageName, paths);
|
|
40
|
+
if (!packageEntry) return;
|
|
41
|
+
const packageRoot = findPackageRoot(packageEntry, packageName);
|
|
42
|
+
const packageFile = packageRoot ? node_path.join(packageRoot, filePath) : void 0;
|
|
43
|
+
return packageFile && node_fs.existsSync(packageFile) ? node_fs.realpathSync(packageFile) : void 0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function findPackageRoot(entryFile, packageName) {
|
|
47
|
+
let directory = node_path.dirname(entryFile);
|
|
48
|
+
while(directory !== node_path.dirname(directory)){
|
|
49
|
+
const packageJsonPath = node_path.join(directory, 'package.json');
|
|
50
|
+
try {
|
|
51
|
+
const packageJson = JSON.parse(node_fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
52
|
+
if (packageJson.name === packageName) return directory;
|
|
53
|
+
} catch {}
|
|
54
|
+
directory = node_path.dirname(directory);
|
|
42
55
|
}
|
|
43
56
|
}
|
|
44
57
|
function setAliasIfPresent(alias, name, value) {
|
|
@@ -136,7 +149,7 @@ function getBuilderEnvironments(normalizedConfig, appContext, tempBuilderConfig)
|
|
|
136
149
|
appContext.appDirectory,
|
|
137
150
|
process.cwd()
|
|
138
151
|
]) : void 0;
|
|
139
|
-
const loadableComponentFile = useCloudflareModuleWorker ?
|
|
152
|
+
const loadableComponentFile = useCloudflareModuleWorker ? resolvePackageFile('@loadable/component', 'dist/esm/loadable.esm.mjs', [
|
|
140
153
|
appContext.appDirectory,
|
|
141
154
|
process.cwd(),
|
|
142
155
|
CLOUDFLARE_WORKER_COMPAT_TEMPLATE_DIR
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.2.0-ultramodern.
|
|
20
|
+
"version": "3.2.0-ultramodern.94",
|
|
21
21
|
"types": "./dist/types/index.d.ts",
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"exports": {
|
|
@@ -99,16 +99,16 @@
|
|
|
99
99
|
"ndepe": "^0.1.13",
|
|
100
100
|
"pkg-types": "^2.3.1",
|
|
101
101
|
"std-env": "4.1.0",
|
|
102
|
-
"@modern-js/
|
|
103
|
-
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.
|
|
104
|
-
"@modern-js/
|
|
105
|
-
"@modern-js/
|
|
106
|
-
"@modern-js/plugin
|
|
107
|
-
"@modern-js/server": "npm:@bleedingdev/modern-js-server@3.2.0-ultramodern.
|
|
108
|
-
"@modern-js/
|
|
109
|
-
"@modern-js/server
|
|
110
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.
|
|
111
|
-
"@modern-js/
|
|
102
|
+
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.94",
|
|
103
|
+
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.2.0-ultramodern.94",
|
|
104
|
+
"@modern-js/server": "npm:@bleedingdev/modern-js-server@3.2.0-ultramodern.94",
|
|
105
|
+
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.2.0-ultramodern.94",
|
|
106
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.94",
|
|
107
|
+
"@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.2.0-ultramodern.94",
|
|
108
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.94",
|
|
109
|
+
"@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.2.0-ultramodern.94",
|
|
110
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.94",
|
|
111
|
+
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.2.0-ultramodern.94"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@rslib/core": "0.21.5",
|