dashboard-shell-shell 0.0.1 → 0.0.3
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/package.json +1 -1
- package/pkg/tsconfig.json +9 -9
- package/pkg/vue.config.js +1 -1
- package/vue.config.js +16 -84
package/package.json
CHANGED
package/pkg/tsconfig.json
CHANGED
|
@@ -27,25 +27,25 @@
|
|
|
27
27
|
],
|
|
28
28
|
"paths": {
|
|
29
29
|
"@shell/core/*": [
|
|
30
|
-
"../../node_modules
|
|
30
|
+
"../../node_modules/dashboard-shell-shell/core/*"
|
|
31
31
|
],
|
|
32
32
|
"@shell/config/*": [
|
|
33
|
-
"../../node_modules
|
|
33
|
+
"../../node_modules/dashboard-shell-shell/config/*"
|
|
34
34
|
],
|
|
35
35
|
"@shell/store/*": [
|
|
36
|
-
"../../node_modules
|
|
36
|
+
"../../node_modules/dashboard-shell-shell/store/*"
|
|
37
37
|
],
|
|
38
38
|
"@shell/plugins/*": [
|
|
39
|
-
"../../node_modules
|
|
39
|
+
"../../node_modules/dashboard-shell-shell/plugins/*"
|
|
40
40
|
],
|
|
41
41
|
"@shell/utils/*": [
|
|
42
|
-
"../../node_modules
|
|
42
|
+
"../../node_modules/dashboard-shell-shell/utils/*"
|
|
43
43
|
],
|
|
44
44
|
"@shell/models/*": [
|
|
45
|
-
"../../node_modules
|
|
45
|
+
"../../node_modules/dashboard-shell-shell/models/*"
|
|
46
46
|
],
|
|
47
47
|
"@shell/mixins/*": [
|
|
48
|
-
"../../node_modules
|
|
48
|
+
"../../node_modules/dashboard-shell-shell/mixins/*"
|
|
49
49
|
],
|
|
50
50
|
"@pkg/*": [
|
|
51
51
|
"./*"
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"**/*.ts",
|
|
57
57
|
"**/*.tsx",
|
|
58
58
|
"**/*.vue",
|
|
59
|
-
"../../node_modules
|
|
60
|
-
"../../node_modules
|
|
59
|
+
"../../node_modules/dashboard-shell-shell/types/*.d.ts",
|
|
60
|
+
"../../node_modules/dashboard-shell-shell/core/types.ts"
|
|
61
61
|
],
|
|
62
62
|
"exclude": [
|
|
63
63
|
"node_modules"
|
package/pkg/vue.config.js
CHANGED
|
@@ -117,7 +117,7 @@ module.exports = function(dir) {
|
|
|
117
117
|
if (p.use) {
|
|
118
118
|
p.use.forEach((u) => {
|
|
119
119
|
if (u.loader.includes('babel-loader')) {
|
|
120
|
-
p.exclude = /node_modules\/(
|
|
120
|
+
p.exclude = /node_modules\/(?!dashboard-shell-shell\/).*/;
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
123
|
}
|
package/vue.config.js
CHANGED
|
@@ -37,79 +37,27 @@ const perfTest = (process.env.PERF_TEST === 'true'); // Enable performance testi
|
|
|
37
37
|
* Paths to the shell folder when it is included as a node dependency
|
|
38
38
|
*/
|
|
39
39
|
const getShellPaths = (dir) => {
|
|
40
|
-
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
console.log('初始SHELL_ABS:', SHELL_ABS);
|
|
45
|
-
console.log('初始COMPONENTS_DIR:', COMPONENTS_DIR);
|
|
46
|
-
|
|
47
|
-
// 检查初始路径是否存在
|
|
40
|
+
let SHELL_ABS = path.join(dir, 'node_modules/dashboard-shell-shell');
|
|
41
|
+
let COMPONENTS_DIR = path.join(SHELL_ABS, 'rancher-components');
|
|
42
|
+
|
|
48
43
|
if (fs.existsSync(SHELL_ABS)) {
|
|
49
44
|
const stat = fs.lstatSync(SHELL_ABS);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// 处理符号链接情况
|
|
45
|
+
|
|
46
|
+
// If @rancher/shell is a symlink, then use the components folder for it
|
|
54
47
|
if (stat.isSymbolicLink()) {
|
|
55
|
-
const REAL_SHELL_ABS = fs.realpathSync(SHELL_ABS);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
// 根据实际项目结构调整符号链接后的组件路径
|
|
59
|
-
// 这里假设符号链接指向项目根目录,组件在 pkg/rancher-components/src/components
|
|
60
|
-
COMPONENTS_DIR = path.join(REAL_SHELL_ABS, 'pkg', 'rancher-components', 'src', 'components');
|
|
61
|
-
|
|
62
|
-
// 如果上述路径不存在,尝试其他可能的路径
|
|
63
|
-
if (!fs.existsSync(COMPONENTS_DIR)) {
|
|
64
|
-
console.log('备选路径1不存在,尝试备选路径2');
|
|
65
|
-
COMPONENTS_DIR = path.join(REAL_SHELL_ABS, '..', 'pkg', 'rancher-components', 'src', 'components');
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// 验证组件目录是否存在
|
|
70
|
-
if (!fs.existsSync(COMPONENTS_DIR)) {
|
|
71
|
-
console.log('警告: 计算出的组件目录不存在:', COMPONENTS_DIR);
|
|
72
|
-
|
|
73
|
-
// 尝试备选路径
|
|
74
|
-
const altComponentsDir = path.join(SHELL_ABS,'..', 'pkg', 'rancher-components', 'src', 'components');
|
|
75
|
-
if (fs.existsSync(altComponentsDir)) {
|
|
76
|
-
console.log('使用备选组件目录:', altComponentsDir);
|
|
77
|
-
COMPONENTS_DIR = altComponentsDir;
|
|
78
|
-
}
|
|
48
|
+
const REAL_SHELL_ABS = fs.realpathSync(SHELL_ABS); // In case the shell is being linked via 'yarn link'
|
|
49
|
+
|
|
50
|
+
COMPONENTS_DIR = path.join(REAL_SHELL_ABS, '..', 'pkg', 'rancher-components', 'src', 'components');
|
|
79
51
|
}
|
|
80
|
-
} else {
|
|
81
|
-
console.log('警告: SHELL_ABS 路径不存在:', SHELL_ABS);
|
|
82
52
|
}
|
|
83
|
-
|
|
84
|
-
//
|
|
85
|
-
|
|
86
|
-
if (fs.existsSync(
|
|
87
|
-
|
|
88
|
-
SHELL_ABS = localShellPath;
|
|
89
|
-
|
|
90
|
-
// 根据实际项目结构调整本地开发时的组件路径
|
|
53
|
+
|
|
54
|
+
// If we have a local folder named 'shell' then use that rather than the one in node_modules
|
|
55
|
+
// This will be the case in the main dashboard repository.
|
|
56
|
+
if (fs.existsSync(path.join(dir, 'shell'))) {
|
|
57
|
+
SHELL_ABS = path.join(dir, 'shell');
|
|
91
58
|
COMPONENTS_DIR = path.join(dir, 'pkg', 'rancher-components', 'src', 'components');
|
|
92
|
-
|
|
93
|
-
// 验证路径是否存在
|
|
94
|
-
if (!fs.existsSync(COMPONENTS_DIR)) {
|
|
95
|
-
console.log('警告: 本地开发组件目录不存在:', COMPONENTS_DIR);
|
|
96
|
-
|
|
97
|
-
// 尝试备选路径
|
|
98
|
-
const altLocalComponentsDir = path.join(SHELL_ABS, 'rancher-components');
|
|
99
|
-
if (fs.existsSync(altLocalComponentsDir)) {
|
|
100
|
-
console.log('使用本地备选组件目录:', altLocalComponentsDir);
|
|
101
|
-
COMPONENTS_DIR = altLocalComponentsDir;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
59
|
}
|
|
105
|
-
|
|
106
|
-
console.log('最终SHELL_ABS:', SHELL_ABS);
|
|
107
|
-
console.log('最终COMPONENTS_DIR:', COMPONENTS_DIR);
|
|
108
|
-
|
|
109
|
-
// 验证关键组件是否存在
|
|
110
|
-
const testComponentPath = path.join(COMPONENTS_DIR, 'Banner.vue');
|
|
111
|
-
console.log('测试组件 (Banner.vue) 是否存在:', fs.existsSync(testComponentPath));
|
|
112
|
-
|
|
60
|
+
|
|
113
61
|
return { SHELL_ABS, COMPONENTS_DIR };
|
|
114
62
|
};
|
|
115
63
|
|
|
@@ -209,7 +157,7 @@ const getLoaders = (SHELL_ABS) => [
|
|
|
209
157
|
test: /\.m?[tj]sx?$/,
|
|
210
158
|
// This excludes no modules except for node_modules/@rancher/... so that plugins can properly compile
|
|
211
159
|
// when referencing @rancher/shell
|
|
212
|
-
exclude: /node_modules\/(?!(
|
|
160
|
+
exclude: /node_modules\/(?!(dashboard-shell-shell)\/).*/,
|
|
213
161
|
use: [
|
|
214
162
|
{
|
|
215
163
|
loader: 'cache-loader',
|
|
@@ -590,11 +538,6 @@ module.exports = function(dir, appConfig = {}) {
|
|
|
590
538
|
config.resolve.alias['@shell'] = SHELL_ABS;
|
|
591
539
|
config.resolve.alias['@pkg'] = path.join(dir, 'pkg');
|
|
592
540
|
config.resolve.alias['./node_modules'] = path.join(dir, 'node_modules');
|
|
593
|
-
|
|
594
|
-
console.log('SHELL_ABS 路径:', SHELL_ABS);
|
|
595
|
-
console.log('@components 路径:', COMPONENTS_DIR);
|
|
596
|
-
console.log('Radio 组件是否存在:', fs.existsSync(path.join(COMPONENTS_DIR, 'Form/Radio.vue')));
|
|
597
|
-
|
|
598
541
|
config.resolve.alias['@components'] = COMPONENTS_DIR;
|
|
599
542
|
config.resolve.alias['vue$'] = dev ? path.resolve(process.cwd(), 'node_modules', 'vue') : 'vue';
|
|
600
543
|
config.resolve.modules.push(__dirname);
|
|
@@ -610,17 +553,6 @@ module.exports = function(dir, appConfig = {}) {
|
|
|
610
553
|
|
|
611
554
|
config.plugins.push(new webpack.IgnorePlugin({ resourceRegExp: /\/__tests__\// }));
|
|
612
555
|
|
|
613
|
-
// 添加模块替换插件用于调试
|
|
614
|
-
config.plugins.push(
|
|
615
|
-
new webpack.NormalModuleReplacementPlugin(/.*/, (resource) => {
|
|
616
|
-
if (resource.request.startsWith('@components/Form/Radio')) {
|
|
617
|
-
console.log('尝试解析组件:', resource.request);
|
|
618
|
-
console.log('解析路径:', path.join(COMPONENTS_DIR, resource.request.substr('@components/'.length)));
|
|
619
|
-
}
|
|
620
|
-
})
|
|
621
|
-
)
|
|
622
|
-
|
|
623
|
-
|
|
624
556
|
config.resolve.extensions.push(...['.tsx', '.ts', '.js', '.vue', '.scss']);
|
|
625
557
|
config.watchOptions = {
|
|
626
558
|
...(config.watchOptions || {}),
|
|
@@ -642,4 +574,4 @@ module.exports = function(dir, appConfig = {}) {
|
|
|
642
574
|
};
|
|
643
575
|
|
|
644
576
|
return config;
|
|
645
|
-
};
|
|
577
|
+
};
|