Skip to content

Commit

Permalink
Merge pull request #12888 from rak-phillip/chore/typescript-enhancement
Browse files Browse the repository at this point in the history
Update typescript configs for better in-editor support
  • Loading branch information
rak-phillip authored Dec 18, 2024
2 parents e1da199 + 3ff0653 commit af63f80
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 97 deletions.
1 change: 1 addition & 0 deletions docusaurus/docs/extensions/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

| Date | Version | Description |
|---|---|---|
| TBD | [**3.1.0**](https://github.com/rancher/dashboard/releases) | [BREAKING] Bump TypeScript from 4.5.5 to 5.6.3: Extension developers need to bump TypeScript to version 5.6.3 in their projects. |
| 01 November 2024 | [**2.0.2**](https://github.com/rancher/dashboard/releases/tag/shell-pkg-v2.0.2) | Remove upper limit on kube version for default annotations on extensions. Update creators package. Minor bug fixes |
| 09 July 2024 | 1.2.3 | Minor bug fixes |
| 09 July 2024 | [**2.0.1**](https://github.com/rancher/dashboard/releases/tag/shell-pkg-v2.0.1) | Minor bug fixes |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
"start-server-and-test": "1.13.1",
"style-loader": "3.3.2",
"ts-jest": "27.1.4",
"typescript": "4.5.5",
"typescript": "5.6.3",
"vue": "3.2.47",
"webpack-bundle-analyzer": "4.5.0",
"webpack-virtual-modules": "0.4.3",
Expand Down
10 changes: 7 additions & 3 deletions pkg/aks/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,21 @@
"../../shell/*"
],
"@components/*": [
"@rancher/components/*"
"../../pkg/rancher-components/src/components/*"
],
"@pkg/*": [
"../../pkg/*"
]
}
},
"include": [
"**/*.ts",
"**/*.d.ts",
"**/*.tsx",
"**/*.vue"
"**/*.vue",
"../../shell/types/vue-shim.d.ts"
],
"exclude": [
"../../node_modules"
]
}
}
7 changes: 4 additions & 3 deletions pkg/eks/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@
"../../shell/*"
],
"@components/*": [
"@rancher/components/*"
"../../pkg/rancher-components/src/components/*"
]
}
},
"include": [
"**/*.ts",
"**/*.d.ts",
"**/*.tsx",
"**/*.vue"
"**/*.vue",
"../../shell/types/vue-shim.d.ts"
],
"exclude": [
"../../node_modules"
]
}
}
7 changes: 4 additions & 3 deletions pkg/gke/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@
"../../shell/*"
],
"@components/*": [
"@rancher/components/*"
"../../pkg/rancher-components/src/components/*"
]
}
},
"include": [
"**/*.ts",
"**/*.d.ts",
"**/*.tsx",
"**/*.vue"
"**/*.vue",
"../../shell/types/vue-shim.d.ts"
],
"exclude": [
"../../node_modules"
]
}
}
5 changes: 3 additions & 2 deletions pkg/harvester-manager/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@
"**/*.ts",
"**/*.tsx",
"**/*.vue",
"../../shell/core/types.ts"
"../../shell/core/types.ts",
"../../shell/types/vue-shim.d.ts"
],
"exclude": [
"node_modules"
]
}
}
7 changes: 4 additions & 3 deletions pkg/kubectl-explain/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@
"../../shell/*"
],
"@components/*": [
"@rancher/components/*"
"../../pkg/rancher-components/src/components/*"
]
}
},
"include": [
"**/*.ts",
"**/*.d.ts",
"**/*.tsx",
"**/*.vue"
"**/*.vue",
"../../shell/types/vue-shim.d.ts"
],
"exclude": [
"../../node_modules"
]
}
}
2 changes: 1 addition & 1 deletion pkg/rancher-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"jsonpath-plus": "10.0.7",
"sass": "1.55.0",
"sass-loader": "~12.0.0",
"typescript": "4.5.5",
"typescript": "5.6.3",
"vue": "~3.2.13",
"eslint-plugin-local-rules": "link:../../eslint-plugin-local-rules"
},
Expand Down
2 changes: 1 addition & 1 deletion shell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"start-server-and-test": "1.13.1",
"style-loader": "1.2.1",
"ts-node": "8.10.2",
"typescript": "4.5.5",
"typescript": "5.6.3",
"ufo": "0.7.11",
"unfetch": "4.2.0",
"url-parse": "1.5.10",
Expand Down
8 changes: 7 additions & 1 deletion shell/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
"../node_modules/@types"
],
},
"include": [
"./**/*.ts",
"./**/*.d.ts",
"./**/*.tsx",
"./**/*.vue"
],
"exclude": [
"node_modules",
"dist",
Expand All @@ -38,4 +44,4 @@
"../docusaurus",
"../**/*.spec.ts"
]
}
}
37 changes: 6 additions & 31 deletions shell/types/vue-shim.d.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,13 @@
// eslint-disable-next-line no-unused-vars
import Vue, { ComponentCustomProperties } from 'vue';
declare module '*.vue' {
export default Vue;
}
/* eslint-disable */
import type { DefineComponent } from 'vue'
import { ComponentCustomProperties } from 'vue';

// This is required to keep typescript from complaining. It is required for
// our i18n plugin. For more info see:
// https://v2.vuejs.org/v2/guide/typescript.html?redirect=true#Augmenting-Types-for-Use-with-Plugins
declare module 'vue/types/vue' {
// eslint-disable-next-line no-unused-vars
interface Vue {
/**
* Lookup a given string with the given arguments
* @param raw if set, do not do HTML escaping.
*/
t: {
(key: string, args?: Record<string, any>, raw?: boolean): string;
(options: { k: string; raw?: boolean; tag?: string | Record<string, any>; escapehtml?: boolean }): string;
};
}
declare module '*.vue' {
const component: DefineComponent<{}, {}, any>
export default component
}

declare module '@vue/runtime-core' {
// eslint-disable-next-line no-unused-vars
interface Vue {
t: {
(key: string, args?: Record<string, any>, raw?: boolean): string;
(options: { k: string; raw?: boolean; tag?: string | Record<string, any>; escapehtml?: boolean }): string;
}
}

// eslint-disable-next-line no-unused-vars
interface ComponentCustomProperties {
t: {
(key: string, args?: Record<string, any>, raw?: boolean): string;
Expand All @@ -47,5 +24,3 @@ declare module '@vue/runtime-core' {
}
}
}

declare module 'js-yaml';
8 changes: 4 additions & 4 deletions shell/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13278,10 +13278,10 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"

typescript@4.5.5:
version "4.5.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3"
integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==
typescript@5.6.3:
version "5.6.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz#5f3449e31c9d94febb17de03cc081dd56d81db5b"
integrity sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==

ua-parser-js@^1.0.38:
version "1.0.38"
Expand Down
52 changes: 8 additions & 44 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9329,18 +9329,7 @@ html-tags@^3.3.1:
tapable "^1.1.3"
util.promisify "1.0.0"

"html-webpack-plugin-5@npm:html-webpack-plugin@^5":
version "5.6.0"
resolved "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.6.0.tgz#50a8fa6709245608cb00e811eacecb8e0d7b7ea0"
integrity sha512-iwaY4wzbe48AfKLZ/Cc8k0L+FKG6oSNRaZ8x5A/T/IVDGyXcbHncM9TdDa93wn0FsSm82FhTKW7f3vS61thXAw==
dependencies:
"@types/html-minifier-terser" "^6.0.0"
html-minifier-terser "^6.0.2"
lodash "^4.17.21"
pretty-error "^4.0.0"
tapable "^2.0.0"

html-webpack-plugin@^5.0.0, html-webpack-plugin@^5.1.0:
"html-webpack-plugin-5@npm:html-webpack-plugin@^5", html-webpack-plugin@^5.0.0, html-webpack-plugin@^5.1.0:
version "5.6.0"
resolved "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.6.0.tgz#50a8fa6709245608cb00e811eacecb8e0d7b7ea0"
integrity sha512-iwaY4wzbe48AfKLZ/Cc8k0L+FKG6oSNRaZ8x5A/T/IVDGyXcbHncM9TdDa93wn0FsSm82FhTKW7f3vS61thXAw==
Expand Down Expand Up @@ -13944,7 +13933,7 @@ string-length@^4.0.1:
char-regex "^1.0.2"
strip-ansi "^6.0.0"

"string-width-cjs@npm:string-width@^4.2.0":
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand All @@ -13961,15 +13950,6 @@ string-width@^2.1.1:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^4.0.0"

string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^5.0.1, string-width@^5.1.2:
version "5.1.2"
resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794"
Expand Down Expand Up @@ -14021,7 +14001,7 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand All @@ -14042,13 +14022,6 @@ strip-ansi@^4.0.0:
dependencies:
ansi-regex "^3.0.0"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^7.0.1:
version "7.1.0"
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
Expand Down Expand Up @@ -14595,10 +14568,10 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"

typescript@4.5.5:
version "4.5.5"
resolved "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3"
integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==
typescript@5.6.3:
version "5.6.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz#5f3449e31c9d94febb17de03cc081dd56d81db5b"
integrity sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==

ua-parser-js@^1.0.38:
version "1.0.38"
Expand Down Expand Up @@ -15324,7 +15297,7 @@ worker-loader@3.0.8:
loader-utils "^2.0.0"
schema-utils "^3.0.0"

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand All @@ -15350,15 +15323,6 @@ wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
Expand Down

0 comments on commit af63f80

Please sign in to comment.