@rancher/shell 1.2.3 → 1.2.5
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/assets/translations/en-us.yaml +49 -18
- package/assets/translations/zh-hans.yaml +1 -0
- package/cloud-credential/__tests__/harvester.test.ts +18 -0
- package/cloud-credential/harvester.vue +9 -1
- package/components/AlertTable.vue +17 -7
- package/components/GrafanaDashboard.vue +6 -4
- package/components/nav/Header.vue +9 -5
- package/components/nav/TopLevelMenu.vue +1 -4
- package/config/product/explorer.js +11 -4
- package/config/settings.ts +9 -2
- package/config/types.js +1 -1
- package/config/uiplugins.js +2 -2
- package/detail/catalog.cattle.io.app.vue +17 -4
- package/edit/management.cattle.io.setting.vue +15 -2
- package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +8 -2
- package/edit/provisioning.cattle.io.cluster/__tests__/RegistryConfigs.test.ts +61 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/utils/cluster.ts +386 -0
- package/edit/provisioning.cattle.io.cluster/rke2.vue +73 -77
- package/edit/provisioning.cattle.io.cluster/tabs/AddOnAdditionalManifest.vue +45 -0
- package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +97 -0
- package/mixins/chart.js +6 -2
- package/models/catalog.cattle.io.app.js +112 -21
- package/models/management.cattle.io.cluster.js +18 -6
- package/package.json +1 -1
- package/pages/c/_cluster/apps/charts/install.vue +2 -1
- package/plugins/dashboard-store/actions.js +3 -2
- package/scripts/extension/bundle +1 -1
- package/scripts/publish-shell.sh +62 -55
- package/scripts/test-plugins-build.sh +111 -29
- package/scripts/typegen.sh +26 -23
- package/store/catalog.js +1 -1
- package/store/features.js +1 -0
- package/store/type-map.utils.ts +44 -0
- package/types/shell/index.d.ts +2 -0
- package/types/store/dashboard-store.types.ts +23 -0
- package/types/store/vuex.d.ts +9 -0
- package/utils/cluster.js +9 -0
- package/utils/v-sphere.ts +277 -0
- package/.DS_Store +0 -0
- package/creators/app/app.package.json +0 -13
- package/creators/app/files/.eslintignore +0 -18
- package/creators/app/files/.eslintrc.js +0 -173
- package/creators/app/files/.gitignore +0 -70
- package/creators/app/files/.vscode/settings.json +0 -22
- package/creators/app/files/babel.config.js +0 -1
- package/creators/app/files/tsconfig.json +0 -42
- package/creators/app/files/vue.config.js +0 -6
- package/creators/app/init +0 -101
- package/creators/app/package.json +0 -25
- package/creators/pkg/files/.github/workflows/build-extension-catalog.yml +0 -28
- package/creators/pkg/files/.github/workflows/build-extension-charts.yml +0 -26
- package/creators/pkg/files/babel.config.js +0 -1
- package/creators/pkg/files/index.ts +0 -14
- package/creators/pkg/files/tsconfig.json +0 -53
- package/creators/pkg/files/vue.config.js +0 -1
- package/creators/pkg/init +0 -254
- package/creators/pkg/package.json +0 -19
- package/creators/pkg/pkg.package.json +0 -21
- package/creators/pkg/vue-shim.ts +0 -4
- package/creators/update/init +0 -56
- package/creators/update/package.json +0 -20
- package/creators/update/upgrade +0 -56
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import merge from 'lodash/merge';
|
|
2
|
+
import { SECRET } from '@shell/config/types';
|
|
3
|
+
import { PROVISIONING_PRE_BOOTSTRAP } from '@shell/store/features';
|
|
4
|
+
|
|
5
|
+
export const VMWARE_VSPHERE = 'vmwarevsphere';
|
|
6
|
+
|
|
7
|
+
type Rke2Component = {
|
|
8
|
+
versionInfo: any;
|
|
9
|
+
userChartValues: any;
|
|
10
|
+
chartVersionKey: (chartName: string) => string;
|
|
11
|
+
value: any;
|
|
12
|
+
isEdit: boolean;
|
|
13
|
+
provider: string;
|
|
14
|
+
$store: any,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type SecretDetails = {
|
|
18
|
+
generateName: string,
|
|
19
|
+
upstreamClusterName: string,
|
|
20
|
+
upstreamNamespace: string,
|
|
21
|
+
downstreamName: string,
|
|
22
|
+
downstreamNamespace: string,
|
|
23
|
+
json?: object,
|
|
24
|
+
}
|
|
25
|
+
type Values = any;
|
|
26
|
+
|
|
27
|
+
type ChartValues = {
|
|
28
|
+
defaultValues: Values,
|
|
29
|
+
userValues: Values,
|
|
30
|
+
combined: Values,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const rootGenerateName = 'vsphere-secret-';
|
|
34
|
+
|
|
35
|
+
type SecretJson = any;
|
|
36
|
+
|
|
37
|
+
class VSphereUtils {
|
|
38
|
+
private async findSecret(
|
|
39
|
+
{ $store }: Rke2Component, {
|
|
40
|
+
generateName, upstreamClusterName, upstreamNamespace, downstreamName, downstreamNamespace
|
|
41
|
+
}: SecretDetails): Promise<SecretJson | undefined> {
|
|
42
|
+
const secrets = await $store.dispatch('management/request', { url: `/v1/${ SECRET }/${ upstreamNamespace }?filter=metadata.name=${ generateName }` });
|
|
43
|
+
|
|
44
|
+
const applicableSecret = secrets.data?.filter((s: any) => {
|
|
45
|
+
return s.metadata.annotations['provisioning.cattle.io/sync-target-namespace'] === downstreamNamespace &&
|
|
46
|
+
s.metadata.annotations['provisioning.cattle.io/sync-target-name'] === downstreamName &&
|
|
47
|
+
s.metadata.annotations['rke.cattle.io/object-authorized-for-clusters'].includes(upstreamClusterName);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
if (applicableSecret.length > 1) {
|
|
51
|
+
return Promise.reject(new Error(`Found multiple matching secrets (${ upstreamNamespace }/${ upstreamNamespace } for ${ upstreamClusterName }), this will cause synchronizing mishaps. Consider removing stale secrets from old clusters`));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return applicableSecret[0];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
private async findOrCreateSecret(
|
|
58
|
+
rke2Component: Rke2Component,
|
|
59
|
+
{
|
|
60
|
+
generateName, upstreamClusterName, upstreamNamespace, downstreamName, downstreamNamespace, json
|
|
61
|
+
}: SecretDetails
|
|
62
|
+
) {
|
|
63
|
+
const { $store } = rke2Component;
|
|
64
|
+
|
|
65
|
+
const secretJson = await this.findSecret(rke2Component, {
|
|
66
|
+
generateName,
|
|
67
|
+
upstreamClusterName,
|
|
68
|
+
upstreamNamespace,
|
|
69
|
+
downstreamName,
|
|
70
|
+
downstreamNamespace
|
|
71
|
+
}) || json;
|
|
72
|
+
|
|
73
|
+
return await $store.dispatch('management/create', secretJson);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private findChartValues({
|
|
77
|
+
versionInfo,
|
|
78
|
+
userChartValues,
|
|
79
|
+
chartVersionKey,
|
|
80
|
+
}: Rke2Component, chartName: string): ChartValues | undefined {
|
|
81
|
+
const chartValues = versionInfo[chartName]?.values;
|
|
82
|
+
|
|
83
|
+
if (!chartValues) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const userValues = userChartValues[chartVersionKey(chartName)];
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
defaultValues: chartValues,
|
|
90
|
+
userValues,
|
|
91
|
+
combined: merge({}, chartValues || {}, userValues || {})
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
private handleVsphereSecret({ $store, provider }: { $store: any, provider: string}): boolean {
|
|
96
|
+
if (provider !== VMWARE_VSPHERE) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const isPrebootstrapEnabled = $store.getters['features/get'](PROVISIONING_PRE_BOOTSTRAP);
|
|
101
|
+
|
|
102
|
+
if (!isPrebootstrapEnabled) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Create upstream vsphere cpi secret to sync downstream
|
|
111
|
+
*/
|
|
112
|
+
async handleVsphereCpiSecret(rke2Component: Rke2Component) {
|
|
113
|
+
if (!this.handleVsphereSecret(rke2Component)) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const generateName = `${ rootGenerateName }cpi-`;
|
|
118
|
+
const downstreamName = 'rancher-vsphere-cpi-credentials';
|
|
119
|
+
const downstreamNamespace = 'kube-system';
|
|
120
|
+
const { value } = rke2Component;
|
|
121
|
+
|
|
122
|
+
// check values for cpi chart has 'use our method' checkbox
|
|
123
|
+
const { userValues, combined } = this.findChartValues(rke2Component, 'rancher-vsphere-cpi') || {};
|
|
124
|
+
|
|
125
|
+
if (!combined?.vCenter?.credentialsSecret?.generate) {
|
|
126
|
+
if (userValues?.vCenter?.username) {
|
|
127
|
+
userValues.vCenter.username = '';
|
|
128
|
+
}
|
|
129
|
+
if (userValues?.vCenter?.password) {
|
|
130
|
+
userValues.vCenter.password = '';
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// find values needed in cpi chart value - https://github.com/rancher/vsphere-charts/blob/main/charts/rancher-vsphere-cpi/questions.yaml#L16-L42
|
|
137
|
+
const { username, password, host } = combined.vCenter;
|
|
138
|
+
|
|
139
|
+
if (!username || !password || !host) {
|
|
140
|
+
throw new Error('vSphere CPI username, password and host are all required when generating a new secret');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// create secret as per https://github.com/rancher/vsphere-charts/blob/main/charts/rancher-vsphere-cpi/templates/secret.yaml
|
|
144
|
+
const upstreamClusterName = value.metadata.name;
|
|
145
|
+
const upstreamNamespace = value.metadata.namespace;
|
|
146
|
+
const secret = await this.findOrCreateSecret(rke2Component, {
|
|
147
|
+
generateName,
|
|
148
|
+
upstreamClusterName,
|
|
149
|
+
upstreamNamespace,
|
|
150
|
+
downstreamName,
|
|
151
|
+
downstreamNamespace,
|
|
152
|
+
json: {
|
|
153
|
+
type: SECRET,
|
|
154
|
+
metadata: {
|
|
155
|
+
namespace: upstreamNamespace,
|
|
156
|
+
generateName,
|
|
157
|
+
labels: {
|
|
158
|
+
'vsphere-cpi-infra': 'secret',
|
|
159
|
+
component: 'rancher-vsphere-cpi-cloud-controller-manager'
|
|
160
|
+
},
|
|
161
|
+
annotations: {
|
|
162
|
+
'provisioning.cattle.io/sync-target-namespace': downstreamNamespace,
|
|
163
|
+
'provisioning.cattle.io/sync-target-name': downstreamName,
|
|
164
|
+
'rke.cattle.io/object-authorized-for-clusters': upstreamClusterName,
|
|
165
|
+
'provisioning.cattle.io/sync-bootstrap': 'true'
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
secret.setData(`${ host }.username`, username);
|
|
172
|
+
secret.setData(`${ host }.password`, password);
|
|
173
|
+
|
|
174
|
+
await secret.save();
|
|
175
|
+
|
|
176
|
+
// reset cpi chart values
|
|
177
|
+
if (!userValues.vCenter.credentialsSecret) {
|
|
178
|
+
userValues.vCenter.credentialsSecret = {};
|
|
179
|
+
}
|
|
180
|
+
userValues.vCenter.credentialsSecret.generate = false;
|
|
181
|
+
userValues.vCenter.credentialsSecret.name = downstreamName;
|
|
182
|
+
userValues.vCenter.username = '';
|
|
183
|
+
userValues.vCenter.password = '';
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Create upstream vsphere csi secret to sync downstream
|
|
188
|
+
*/
|
|
189
|
+
async handleVsphereCsiSecret(rke2Component: Rke2Component) {
|
|
190
|
+
if (!this.handleVsphereSecret(rke2Component)) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const generateName = `${ rootGenerateName }csi-`;
|
|
195
|
+
const downstreamName = 'rancher-vsphere-csi-credentials';
|
|
196
|
+
const downstreamNamespace = 'kube-system';
|
|
197
|
+
const { value } = rke2Component;
|
|
198
|
+
|
|
199
|
+
// check values for cpi chart has 'use our method' checkbox
|
|
200
|
+
const { userValues, combined } = this.findChartValues(rke2Component, 'rancher-vsphere-csi') || {};
|
|
201
|
+
|
|
202
|
+
if (!combined?.vCenter?.configSecret?.generate) {
|
|
203
|
+
if (userValues?.vCenter?.username) {
|
|
204
|
+
userValues.vCenter.username = '';
|
|
205
|
+
}
|
|
206
|
+
if (userValues?.vCenter?.password) {
|
|
207
|
+
userValues.vCenter.password = '';
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// find values needed in cpi chart value - https://github.com/rancher/vsphere-charts/blob/main/charts/rancher-vsphere-csi/questions.yaml#L1-L36
|
|
214
|
+
const {
|
|
215
|
+
username, password, host, datacenters, port, insecureFlag
|
|
216
|
+
} = combined.vCenter;
|
|
217
|
+
|
|
218
|
+
if (!username || !password || !host || !datacenters) {
|
|
219
|
+
throw new Error('vSphere CSI username, password, host and datacenters are all required when generating a new secret');
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// This is a copy of https://github.com/rancher/vsphere-charts/blob/a5c99d716df960dc50cf417d9ecffad6b55ca0ad/charts/rancher-vsphere-csi/values.yaml#L12-L21
|
|
223
|
+
// Which makes it's way into the secret via https://github.com/rancher/vsphere-charts/blob/main/charts/rancher-vsphere-csi/templates/secret.yaml#L8
|
|
224
|
+
let configTemplateString = ' [Global]\n cluster-id = {{ required \".Values.vCenter.clusterId must be provided\" (default .Values.vCenter.clusterId .Values.global.cattle.clusterId) | quote }}\n user = {{ .Values.vCenter.username | quote }}\n password = {{ .Values.vCenter.password | quote }}\n port = {{ .Values.vCenter.port | quote }}\n insecure-flag = {{ .Values.vCenter.insecureFlag | quote }}\n\n [VirtualCenter {{ .Values.vCenter.host | quote }}]\n datacenters = {{ .Values.vCenter.datacenters | quote }}';
|
|
225
|
+
|
|
226
|
+
configTemplateString = configTemplateString.replace('{{ required \".Values.vCenter.clusterId must be provided\" (default .Values.vCenter.clusterId .Values.global.cattle.clusterId) | quote }}', `"{{clusterId}}"`);
|
|
227
|
+
configTemplateString = configTemplateString.replace('{{ .Values.vCenter.username | quote }}', `"${ username }"`);
|
|
228
|
+
configTemplateString = configTemplateString.replace('{{ .Values.vCenter.password | quote }}', `"${ password }"`);
|
|
229
|
+
configTemplateString = configTemplateString.replace('{{ .Values.vCenter.port | quote }}', `"${ port }"`);
|
|
230
|
+
configTemplateString = configTemplateString.replace('{{ .Values.vCenter.insecureFlag | quote }}', `"${ insecureFlag }"`);
|
|
231
|
+
configTemplateString = configTemplateString.replace('{{ .Values.vCenter.host | quote }}', `"${ host }"`);
|
|
232
|
+
configTemplateString = configTemplateString.replace('{{ .Values.vCenter.datacenters | quote }}', `"${ datacenters }"`);
|
|
233
|
+
// create secret as per https://github.com/rancher/vsphere-charts/blob/main/charts/rancher-vsphere-csi/templates/secret.yaml
|
|
234
|
+
const upstreamClusterName = value.metadata.name;
|
|
235
|
+
const upstreamNamespace = value.metadata.namespace;
|
|
236
|
+
|
|
237
|
+
const secret = await this.findOrCreateSecret(rke2Component, {
|
|
238
|
+
generateName,
|
|
239
|
+
upstreamClusterName,
|
|
240
|
+
upstreamNamespace,
|
|
241
|
+
downstreamName,
|
|
242
|
+
downstreamNamespace,
|
|
243
|
+
json: {
|
|
244
|
+
type: SECRET,
|
|
245
|
+
metadata: {
|
|
246
|
+
namespace: upstreamNamespace,
|
|
247
|
+
generateName,
|
|
248
|
+
annotations: {
|
|
249
|
+
'provisioning.cattle.io/sync-target-namespace': downstreamNamespace,
|
|
250
|
+
'provisioning.cattle.io/sync-target-name': downstreamName,
|
|
251
|
+
'rke.cattle.io/object-authorized-for-clusters': upstreamClusterName,
|
|
252
|
+
'provisioning.cattle.io/sync-bootstrap': 'true'
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
secret.setData(`csi-vsphere.conf`, configTemplateString);
|
|
259
|
+
|
|
260
|
+
await secret.save();
|
|
261
|
+
|
|
262
|
+
// reset csi chart values
|
|
263
|
+
if (!userValues.vCenter.configSecret) {
|
|
264
|
+
userValues.vCenter.configSecret = {};
|
|
265
|
+
}
|
|
266
|
+
userValues.vCenter.configSecret.generate = false;
|
|
267
|
+
userValues.vCenter.configSecret.name = downstreamName;
|
|
268
|
+
userValues.vCenter.username = '';
|
|
269
|
+
userValues.vCenter.password = '';
|
|
270
|
+
userValues.vCenter.host = '';
|
|
271
|
+
userValues.vCenter.datacenters = '';
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
const utils = new VSphereUtils();
|
|
276
|
+
|
|
277
|
+
export default utils;
|
package/.DS_Store
DELETED
|
Binary file
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
assets/fonts
|
|
2
|
-
coverage
|
|
3
|
-
.nyc_output
|
|
4
|
-
node_modules/
|
|
5
|
-
.npm
|
|
6
|
-
.eslintcache
|
|
7
|
-
.env
|
|
8
|
-
.cache
|
|
9
|
-
.next
|
|
10
|
-
.nuxt
|
|
11
|
-
dist
|
|
12
|
-
dist-pkg
|
|
13
|
-
.DS_Store
|
|
14
|
-
dynamic-importer.js
|
|
15
|
-
ksconfig.json
|
|
16
|
-
nuxt.config.js
|
|
17
|
-
shell/utils/dynamic-importer.js
|
|
18
|
-
shell/assets/fonts
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
env: {
|
|
4
|
-
browser: true,
|
|
5
|
-
node: true
|
|
6
|
-
},
|
|
7
|
-
globals: { NodeJS: true, Timer: true },
|
|
8
|
-
extends: [
|
|
9
|
-
'standard',
|
|
10
|
-
'eslint:recommended',
|
|
11
|
-
'@nuxtjs/eslint-config-typescript',
|
|
12
|
-
'plugin:cypress/recommended'
|
|
13
|
-
],
|
|
14
|
-
// add your custom rules here
|
|
15
|
-
rules: {
|
|
16
|
-
'dot-notation': 'off',
|
|
17
|
-
'generator-star-spacing': 'off',
|
|
18
|
-
'guard-for-in': 'off',
|
|
19
|
-
'linebreak-style': 'off',
|
|
20
|
-
'new-cap': 'off',
|
|
21
|
-
'no-empty': 'off',
|
|
22
|
-
'no-extra-boolean-cast': 'off',
|
|
23
|
-
'no-new': 'off',
|
|
24
|
-
'no-plusplus': 'off',
|
|
25
|
-
'no-useless-escape': 'off',
|
|
26
|
-
'nuxt/no-cjs-in-config': 'off',
|
|
27
|
-
'semi-spacing': 'off',
|
|
28
|
-
'space-in-parens': 'off',
|
|
29
|
-
strict: 'off',
|
|
30
|
-
'unicorn/no-new-buffer': 'off',
|
|
31
|
-
'vue/html-self-closing': 'off',
|
|
32
|
-
'vue/no-unused-components': 'warn',
|
|
33
|
-
'vue/no-v-html': 'error',
|
|
34
|
-
'wrap-iife': 'off',
|
|
35
|
-
|
|
36
|
-
'array-bracket-spacing': 'warn',
|
|
37
|
-
'arrow-parens': 'warn',
|
|
38
|
-
'arrow-spacing': ['warn', { before: true, after: true }],
|
|
39
|
-
'block-spacing': ['warn', 'always'],
|
|
40
|
-
'brace-style': ['warn', '1tbs'],
|
|
41
|
-
'comma-dangle': ['warn', 'only-multiline'],
|
|
42
|
-
'comma-spacing': 'warn',
|
|
43
|
-
curly: 'warn',
|
|
44
|
-
eqeqeq: 'warn',
|
|
45
|
-
'func-call-spacing': ['warn', 'never'],
|
|
46
|
-
'implicit-arrow-linebreak': 'warn',
|
|
47
|
-
indent: ['warn', 2],
|
|
48
|
-
'keyword-spacing': 'warn',
|
|
49
|
-
'lines-between-class-members': ['warn', 'always', { exceptAfterSingleLine: true }],
|
|
50
|
-
'multiline-ternary': ['warn', 'never'],
|
|
51
|
-
'newline-per-chained-call': ['warn', { ignoreChainWithDepth: 4 }],
|
|
52
|
-
'no-caller': 'warn',
|
|
53
|
-
'no-cond-assign': ['warn', 'except-parens'],
|
|
54
|
-
'no-console': 'warn',
|
|
55
|
-
'no-debugger': 'warn',
|
|
56
|
-
'no-eq-null': 'warn',
|
|
57
|
-
'no-eval': 'warn',
|
|
58
|
-
'no-trailing-spaces': 'warn',
|
|
59
|
-
'no-undef': 'warn',
|
|
60
|
-
'no-unused-vars': 'warn',
|
|
61
|
-
'no-whitespace-before-property': 'warn',
|
|
62
|
-
'object-curly-spacing': ['warn', 'always'],
|
|
63
|
-
'object-property-newline': 'warn',
|
|
64
|
-
'object-shorthand': 'warn',
|
|
65
|
-
'padded-blocks': ['warn', 'never'],
|
|
66
|
-
'prefer-arrow-callback': 'warn',
|
|
67
|
-
'prefer-template': 'warn',
|
|
68
|
-
'quote-props': 'warn',
|
|
69
|
-
'rest-spread-spacing': 'warn',
|
|
70
|
-
semi: ['warn', 'always'],
|
|
71
|
-
'space-before-function-paren': ['warn', 'never'],
|
|
72
|
-
'space-infix-ops': 'warn',
|
|
73
|
-
'spaced-comment': 'warn',
|
|
74
|
-
'switch-colon-spacing': 'warn',
|
|
75
|
-
'template-curly-spacing': ['warn', 'always'],
|
|
76
|
-
'yield-star-spacing': ['warn', 'both'],
|
|
77
|
-
|
|
78
|
-
'key-spacing': ['warn', {
|
|
79
|
-
align: {
|
|
80
|
-
beforeColon: false,
|
|
81
|
-
afterColon: true,
|
|
82
|
-
on: 'value',
|
|
83
|
-
mode: 'minimum'
|
|
84
|
-
},
|
|
85
|
-
multiLine: {
|
|
86
|
-
beforeColon: false,
|
|
87
|
-
afterColon: true
|
|
88
|
-
},
|
|
89
|
-
}],
|
|
90
|
-
|
|
91
|
-
'object-curly-newline': ['warn', {
|
|
92
|
-
ObjectExpression: {
|
|
93
|
-
multiline: true,
|
|
94
|
-
minProperties: 3
|
|
95
|
-
},
|
|
96
|
-
ObjectPattern: {
|
|
97
|
-
multiline: true,
|
|
98
|
-
minProperties: 4
|
|
99
|
-
},
|
|
100
|
-
ImportDeclaration: {
|
|
101
|
-
multiline: true,
|
|
102
|
-
minProperties: 5
|
|
103
|
-
},
|
|
104
|
-
ExportDeclaration: {
|
|
105
|
-
multiline: true,
|
|
106
|
-
minProperties: 3
|
|
107
|
-
}
|
|
108
|
-
}],
|
|
109
|
-
|
|
110
|
-
'padding-line-between-statements': [
|
|
111
|
-
'warn',
|
|
112
|
-
{
|
|
113
|
-
blankLine: 'always',
|
|
114
|
-
prev: '*',
|
|
115
|
-
next: 'return',
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
blankLine: 'always',
|
|
119
|
-
prev: 'function',
|
|
120
|
-
next: 'function',
|
|
121
|
-
},
|
|
122
|
-
// This configuration would require blank lines after every sequence of variable declarations
|
|
123
|
-
{
|
|
124
|
-
blankLine: 'always',
|
|
125
|
-
prev: ['const', 'let', 'var'],
|
|
126
|
-
next: '*'
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
blankLine: 'any',
|
|
130
|
-
prev: ['const', 'let', 'var'],
|
|
131
|
-
next: ['const', 'let', 'var']
|
|
132
|
-
}
|
|
133
|
-
],
|
|
134
|
-
|
|
135
|
-
quotes: [
|
|
136
|
-
'warn',
|
|
137
|
-
'single',
|
|
138
|
-
{
|
|
139
|
-
avoidEscape: true,
|
|
140
|
-
allowTemplateLiterals: true
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
|
|
144
|
-
'space-unary-ops': [
|
|
145
|
-
'warn',
|
|
146
|
-
{
|
|
147
|
-
words: true,
|
|
148
|
-
nonwords: false,
|
|
149
|
-
}
|
|
150
|
-
],
|
|
151
|
-
|
|
152
|
-
// FIXME: The following is disabled due to new linter and old JS code. These should all be enabled and underlying issues fixed
|
|
153
|
-
'vue/order-in-components': 'off',
|
|
154
|
-
'vue/no-lone-template': 'off',
|
|
155
|
-
'vue/v-slot-style': 'off',
|
|
156
|
-
'vue/component-tags-order': 'off',
|
|
157
|
-
'vue/no-mutating-props': 'off',
|
|
158
|
-
'@typescript-eslint/no-unused-vars': 'off',
|
|
159
|
-
'array-callback-return': 'off',
|
|
160
|
-
},
|
|
161
|
-
overrides: [
|
|
162
|
-
{
|
|
163
|
-
files: ['*.js'],
|
|
164
|
-
rules: {
|
|
165
|
-
// FIXME: The following is disabled due to new linter and old JS code. These should all be enabled and underlying issues fixed
|
|
166
|
-
'prefer-regex-literals': 'off',
|
|
167
|
-
'vue/component-definition-name-casing': 'off',
|
|
168
|
-
'no-unreachable-loop': 'off',
|
|
169
|
-
'computed-property-spacing': 'off',
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
]
|
|
173
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# compiled output
|
|
2
|
-
/dist
|
|
3
|
-
/tmp
|
|
4
|
-
/out-tsc
|
|
5
|
-
|
|
6
|
-
# Runtime data
|
|
7
|
-
pids
|
|
8
|
-
*.pid
|
|
9
|
-
*.seed
|
|
10
|
-
*.pid.lock
|
|
11
|
-
|
|
12
|
-
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
13
|
-
lib-cov
|
|
14
|
-
|
|
15
|
-
# Coverage directory used by tools like istanbul
|
|
16
|
-
coverage
|
|
17
|
-
|
|
18
|
-
# nyc test coverage
|
|
19
|
-
.nyc_output
|
|
20
|
-
|
|
21
|
-
# IDEs and editors
|
|
22
|
-
.idea
|
|
23
|
-
.project
|
|
24
|
-
.classpath
|
|
25
|
-
.c9/
|
|
26
|
-
*.launch
|
|
27
|
-
.settings/
|
|
28
|
-
*.sublime-workspace
|
|
29
|
-
|
|
30
|
-
# IDE - VSCode
|
|
31
|
-
.vscode/*
|
|
32
|
-
!.vscode/settings.json
|
|
33
|
-
!.vscode/tasks.json
|
|
34
|
-
!.vscode/launch.json
|
|
35
|
-
!.vscode/extensions.json
|
|
36
|
-
|
|
37
|
-
# misc
|
|
38
|
-
.sass-cache
|
|
39
|
-
connect.lock
|
|
40
|
-
typings
|
|
41
|
-
|
|
42
|
-
# Logs
|
|
43
|
-
logs
|
|
44
|
-
*.log
|
|
45
|
-
npm-debug.log*
|
|
46
|
-
yarn-debug.log*
|
|
47
|
-
yarn-error.log*
|
|
48
|
-
|
|
49
|
-
# Dependency directories
|
|
50
|
-
node_modules/
|
|
51
|
-
jspm_packages/
|
|
52
|
-
|
|
53
|
-
# Optional npm cache directory
|
|
54
|
-
.npm
|
|
55
|
-
|
|
56
|
-
# Optional eslint cache
|
|
57
|
-
.eslintcache
|
|
58
|
-
|
|
59
|
-
# Optional REPL history
|
|
60
|
-
.node_repl_history
|
|
61
|
-
|
|
62
|
-
# Yarn Integrity file
|
|
63
|
-
.yarn-integrity
|
|
64
|
-
|
|
65
|
-
# dotenv environment variables file
|
|
66
|
-
.env
|
|
67
|
-
|
|
68
|
-
# System Files
|
|
69
|
-
.DS_Store
|
|
70
|
-
Thumbs.db
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"files.exclude": {
|
|
3
|
-
".ackrc": true,
|
|
4
|
-
".dockerignore": true,
|
|
5
|
-
".drone.yml": true,
|
|
6
|
-
".editorconfig": true,
|
|
7
|
-
".eslintcache": true,
|
|
8
|
-
".eslintignore": true,
|
|
9
|
-
".eslintrc.js": true,
|
|
10
|
-
".gitignore": true,
|
|
11
|
-
".nuxt*": true,
|
|
12
|
-
".nyc_output": true,
|
|
13
|
-
".vscode": true,
|
|
14
|
-
"LICENSE": true,
|
|
15
|
-
"node_modules": true,
|
|
16
|
-
"babel.config.js": true,
|
|
17
|
-
"jsconfig.json": true,
|
|
18
|
-
"yarn-error.log": true,
|
|
19
|
-
"pkg/**/.shell": true,
|
|
20
|
-
"pkg/**/node_modules": true,
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('@rancher/shell/babel.config.js');
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2018",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "Node",
|
|
6
|
-
"lib": [
|
|
7
|
-
"ESNext",
|
|
8
|
-
"ESNext.AsyncIterable",
|
|
9
|
-
"DOM"
|
|
10
|
-
],
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"allowJs": true,
|
|
13
|
-
"sourceMap": true,
|
|
14
|
-
"strict": true,
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
"baseUrl": ".",
|
|
17
|
-
"paths": {
|
|
18
|
-
"~/*": [
|
|
19
|
-
"./*"
|
|
20
|
-
],
|
|
21
|
-
"@/*": [
|
|
22
|
-
"./*"
|
|
23
|
-
],
|
|
24
|
-
"@shell/*": [
|
|
25
|
-
"./node_modules/@rancher/shell/*"
|
|
26
|
-
]
|
|
27
|
-
},
|
|
28
|
-
"typeRoots": [
|
|
29
|
-
"./node_modules",
|
|
30
|
-
"./node_modules/@rancher/shell/types"
|
|
31
|
-
],
|
|
32
|
-
"types": [
|
|
33
|
-
"@types/node",
|
|
34
|
-
"cypress",
|
|
35
|
-
"rancher",
|
|
36
|
-
"shell"
|
|
37
|
-
]
|
|
38
|
-
},
|
|
39
|
-
"exclude": [
|
|
40
|
-
"node_modules"
|
|
41
|
-
]
|
|
42
|
-
}
|