Skip to content

Commit

Permalink
feat(misc): support ts 4.9
Browse files Browse the repository at this point in the history
  • Loading branch information
leosvelperez committed Feb 13, 2023
1 parent c712949 commit 993cae0
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 20 deletions.
8 changes: 4 additions & 4 deletions nx-dev/data-access-packages/src/lib/sort-packages.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export function sortCorePackagesFirst<ItemType>(
export function sortCorePackagesFirst<ItemType extends object>(
itemList: ItemType[],
ref: PropertyKey
): ItemType[] {
const nxPackageIds = ['nx', 'workspace', 'devkit', 'nx-plugin'];
function assertRef<OBJECT>(
function assertRef(
value: PropertyKey,
target: OBJECT
): value is keyof OBJECT {
target: ItemType
): value is keyof ItemType {
if (!(value in target))
throw new Error(
`Property '${value.toString()}' can not be found in passed object.`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
"tslint-to-eslint-config": "^2.13.0",
"typedoc": "0.22.9",
"typedoc-plugin-markdown": "3.11.6",
"typescript": "~4.8.2",
"typescript": "~4.9.5",
"unzipper": "^0.10.11",
"url-loader": "^4.1.1",
"verdaccio": "^5.0.4",
Expand Down
7 changes: 6 additions & 1 deletion packages/esbuild/src/executors/esbuild/esbuild.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ const BUILD_WATCH_SUCCEEDED = `[ ${chalk.green(
'watch'
)} ] build succeeded, watching for changes...`;

// since the workspace has esbuild 0.17+ installed, there's no definition
// of esbuild without 'context', therefore, the esbuild import in the else
// branch below has type never, getting the type to cast later
type EsBuild = typeof esbuild;

export async function* esbuildExecutor(
_options: EsBuildExecutorOptions,
context: ExecutorContext
Expand Down Expand Up @@ -296,7 +301,7 @@ export async function* esbuildExecutor(
for (let i = 0; i < options.format.length; i++) {
const format = options.format[i];
const esbuildOptions = buildEsbuildOptions(format, options, context);
const buildResult = await esbuild.build(esbuildOptions);
const buildResult = await (esbuild as EsBuild).build(esbuildOptions);

if (options.metafile) {
const filename =
Expand Down
2 changes: 1 addition & 1 deletion packages/nx/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const nxVersion = require('../../package.json').version;

export const angularCliVersion = '~15.1.0';
export const typescriptVersion = '~4.8.2';
export const typescriptVersion = '~4.9.5';
export const prettierVersion = '^2.6.2';
export const typescriptESLintVersion = '^5.36.1';
export const eslintVersion = '~8.15.0';
Expand Down
9 changes: 9 additions & 0 deletions packages/workspace/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@
"alwaysAddToPackageJson": false
}
}
},
"15.7.1": {
"version": "15.7.1-beta.0",
"x-prompt": "Do you want to update the TypeScript version to v4.9?",
"packages": {
"typescript": {
"version": "~4.9.5"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Object {
"@schematics/angular": "~15.1.0",
"nx": "0.0.1",
"prettier": "^2.6.2",
"typescript": "~4.8.2",
"typescript": "~4.9.5",
},
"license": "MIT",
"name": "my-workspace",
Expand All @@ -29,7 +29,7 @@ Object {
"@nrwl/workspace": "0.0.1",
"nx": "0.0.1",
"prettier": "^2.6.2",
"typescript": "~4.8.2",
"typescript": "~4.9.5",
},
"license": "MIT",
"name": "my-workspace",
Expand All @@ -47,7 +47,7 @@ Object {
"@nrwl/workspace": "0.0.1",
"nx": "0.0.1",
"prettier": "^2.6.2",
"typescript": "~4.8.2",
"typescript": "~4.9.5",
},
"license": "MIT",
"name": "my-workspace",
Expand Down
2 changes: 1 addition & 1 deletion packages/workspace/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const nxVersion = require('../../package.json').version;

export const angularCliVersion = '~15.1.0';
export const typescriptVersion = '~4.8.2';
export const typescriptVersion = '~4.9.5';
export const prettierVersion = '^2.6.2';
export const typescriptESLintVersion = '^5.36.1';
export const eslintVersion = '~8.15.0';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Create packages dictionary mapping
export function convertToDictionary<OBJECT>(
export function convertToDictionary<OBJECT extends object>(
arr: OBJECT[],
ref: PropertyKey
): Record<PropertyKey, OBJECT> {
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24051,15 +24051,15 @@ typescript@4.8.2:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.2.tgz#e3b33d5ccfb5914e4eeab6699cf208adee3fd790"
integrity sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==

typescript@4.9.4, typescript@^4.6.2:
typescript@4.9.4:
version "4.9.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78"
integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==

"typescript@^3 || ^4", typescript@~4.8.2:
version "4.8.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6"
integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==
"typescript@^3 || ^4", typescript@^4.6.2, typescript@~4.9.5:
version "4.9.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==

ua-parser-js@1.0.2:
version "1.0.2"
Expand Down Expand Up @@ -24651,9 +24651,9 @@ vm-browserify@^1.0.1:
integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==

vscode-oniguruma@^1.6.1:
version "1.6.2"
resolved "https://registry.yarnpkg.com/vscode-oniguruma/-/vscode-oniguruma-1.6.2.tgz#aeb9771a2f1dbfc9083c8a7fdd9cccaa3f386607"
integrity sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA==
version "1.7.0"
resolved "https://registry.yarnpkg.com/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz#439bfad8fe71abd7798338d1cd3dc53a8beea94b"
integrity sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==

vscode-textmate@5.2.0:
version "5.2.0"
Expand Down

0 comments on commit 993cae0

Please sign in to comment.