Skip to content

Commit 7efcbfd

Browse files
bump typescript => 5.2.2 (#1979)
## Checklist - [-] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [-] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [x] I have not broken the cheatsheet - [x] Check source maps are working for extension - [x] Check source maps are working in test files - [x] Don't depend on esbuild in all packages? - [x] Try running vsix from CI locally - [-] Use two .. for update recorded tests script --------- Co-authored-by: Andreas Arvidsson <[email protected]>
1 parent d981813 commit 7efcbfd

File tree

64 files changed

+3529
-2886
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3529
-2886
lines changed

.eslintrc.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"ecmaVersion": 6,
1212
"sourceType": "module"
1313
},
14-
"plugins": ["@typescript-eslint", "unused-imports", "import"],
14+
"plugins": ["@typescript-eslint", "unused-imports", "import", "unicorn"],
1515
"rules": {
1616
"import/no-relative-packages": "error",
1717
"@typescript-eslint/consistent-type-assertions": [
@@ -52,7 +52,8 @@
5252
"MemberExpression[object.property.name='constructor'][property.name='name']"
5353
],
5454
"no-throw-literal": "warn",
55-
"semi": "off"
55+
"semi": "off",
56+
"unicorn/prefer-module": "error"
5657
},
5758
"overrides": [
5859
{

.github/workflows/deploy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- uses: pnpm/action-setup@v2
2121
- uses: actions/setup-node@v3
2222
with:
23-
node-version: 16
23+
node-version-file: package.json
2424
cache: pnpm
2525
- run: pnpm --color install
2626
- run: pnpm --color compile

.github/workflows/pre-commit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: pnpm/action-setup@v2
2222
- uses: actions/setup-node@v3
2323
with:
24-
node-version: 16
24+
node-version-file: package.json
2525
cache: pnpm
2626
- run: pnpm --color install
2727
- uses: pre-commit/[email protected]

.github/workflows/test-docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ jobs:
1616
- uses: pnpm/action-setup@v2
1717
- uses: actions/setup-node@v3
1818
with:
19-
node-version: 16
19+
node-version-file: package.json
2020
cache: pnpm
2121
- run: bash -x scripts/build-and-assemble-website.sh

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- uses: pnpm/action-setup@v2
3232
- uses: actions/setup-node@v3
3333
with:
34-
node-version: 16
34+
node-version-file: package.json
3535
cache: pnpm
3636
- run: mkdir -p "${{ env.VSCODE_CRASH_DIR }}" "${{ env.VSCODE_LOGS_DIR }}"
3737
shell: bash

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ repos:
6363
name: format-recorded-tests
6464
files: ^packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/.*/[^/]*\.yml$
6565
language: system
66-
entry: pnpm exec tsx --conditions=cursorless:bundler packages/cursorless-engine/src/scripts/transformRecordedTests/index.ts
66+
entry: pnpm exec ./packages/common/scripts/my-ts-node.js packages/cursorless-engine/src/scripts/transformRecordedTests/index.ts
6767
- repo: local
6868
hooks:
6969
- id: check-recorded-test-marks
7070
name: check-recorded-test-marks
7171
files: ^packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/.*/[^/]*\.yml$
7272
language: system
73-
entry: pnpm exec tsx --conditions=cursorless:bundler packages/cursorless-engine/src/scripts/transformRecordedTests/index.ts --check-marks
73+
entry: pnpm exec ./packages/common/scripts/my-ts-node.js packages/cursorless-engine/src/scripts/transformRecordedTests/index.ts --check-marks
7474
- repo: https://github.com/ikamensh/flynt/
7575
rev: "0.78"
7676
hooks:

.vscode/launch.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"args": [
3535
"--profile=cursorlessDevelopment",
3636
"--extensionDevelopmentPath=${workspaceFolder}/packages/cursorless-vscode/dist",
37-
"--extensionTestsPath=${workspaceFolder}/packages/test-harness/out/runners/extensionTests"
37+
"--extensionTestsPath=${workspaceFolder}/packages/test-harness/dist/extensionTests.cjs"
3838
],
3939
"outFiles": ["${workspaceFolder}/**/out/**/*.js"],
4040
"preLaunchTask": "${defaultBuildTask}",
@@ -55,7 +55,7 @@
5555
"args": [
5656
"--profile=cursorlessDevelopment",
5757
"--extensionDevelopmentPath=${workspaceFolder}/packages/cursorless-vscode/dist",
58-
"--extensionTestsPath=${workspaceFolder}/packages/test-harness/out/runners/extensionTests"
58+
"--extensionTestsPath=${workspaceFolder}/packages/test-harness/dist/extensionTests.cjs"
5959
],
6060
"outFiles": ["${workspaceFolder}/**/out/**/*.js"],
6161
"preLaunchTask": "Prepare test subset",
@@ -68,7 +68,7 @@
6868
"name": "Talon tests",
6969
"type": "node",
7070
"request": "launch",
71-
"program": "${workspaceFolder}/packages/test-harness/out/scripts/runTalonTests",
71+
"program": "${workspaceFolder}/packages/test-harness/dist/runTalonTests.cjs",
7272
"env": {
7373
"CURSORLESS_TEST": "true",
7474
"CURSORLESS_REPO_ROOT": "${workspaceFolder}"
@@ -84,7 +84,7 @@
8484
"name": "Talon tests subset",
8585
"type": "node",
8686
"request": "launch",
87-
"program": "${workspaceFolder}/packages/test-harness/out/scripts/runTalonTests",
87+
"program": "${workspaceFolder}/packages/test-harness/dist/runTalonTests.cjs",
8888
"env": {
8989
"CURSORLESS_TEST": "true",
9090
"CURSORLESS_RUN_TEST_SUBSET": "true",
@@ -101,7 +101,7 @@
101101
"name": "Unit tests only",
102102
"type": "node",
103103
"request": "launch",
104-
"program": "${workspaceFolder}/packages/test-harness/out/scripts/runUnitTestsOnly",
104+
"program": "${workspaceFolder}/packages/test-harness/dist/runUnitTestsOnly.cjs",
105105
"env": {
106106
"CURSORLESS_TEST": "true",
107107
"CURSORLESS_REPO_ROOT": "${workspaceFolder}"
@@ -125,7 +125,7 @@
125125
"args": [
126126
"--profile=cursorlessDevelopment",
127127
"--extensionDevelopmentPath=${workspaceFolder}/packages/cursorless-vscode/dist",
128-
"--extensionTestsPath=${workspaceFolder}/packages/test-harness/out/runners/extensionTests"
128+
"--extensionTestsPath=${workspaceFolder}/packages/test-harness/dist/extensionTests.cjs"
129129
],
130130
"outFiles": ["${workspaceFolder}/**/out/**/*.js"],
131131
"preLaunchTask": "${defaultBuildTask}",
@@ -147,7 +147,7 @@
147147
"args": [
148148
"--profile=cursorlessDevelopment",
149149
"--extensionDevelopmentPath=${workspaceFolder}/packages/cursorless-vscode/dist",
150-
"--extensionTestsPath=${workspaceFolder}/packages/test-harness/out/runners/extensionTests"
150+
"--extensionTestsPath=${workspaceFolder}/packages/test-harness/dist/extensionTests.cjs"
151151
],
152152
"outFiles": ["${workspaceFolder}/**/out/**/*.js"],
153153
"preLaunchTask": "${defaultBuildTask}",
@@ -160,7 +160,7 @@
160160
"name": "Update fixtures, unit tests only",
161161
"type": "node",
162162
"request": "launch",
163-
"program": "${workspaceFolder}/packages/test-harness/out/scripts/runUnitTestsOnly",
163+
"program": "${workspaceFolder}/packages/test-harness/dist/runUnitTestsOnly.cjs",
164164
"env": {
165165
"CURSORLESS_TEST": "true",
166166
"CURSORLESS_TEST_UPDATE_FIXTURES": "true",

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
],
2525
"files.eol": "\n",
2626
"typescript.enablePromptUseWorkspaceTsdk": true,
27-
"typescript.tsdk": "node_modules/typescript/lib"
27+
"typescript.tsdk": "node_modules/typescript/lib",
28+
"eslint.workingDirectories": [{ "pattern": "packages/*/" }]
2829
}

.vscode/tasks.json

+36-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
"tasks": [
66
{
77
"label": "Build",
8-
"dependsOn": ["Populate dist", "ESBuild", "TSBuild"],
8+
"dependsOn": [
9+
"Populate dist",
10+
"ESBuild",
11+
"TSBuild",
12+
"Build test harness"
13+
],
914
"group": {
1015
"kind": "build",
1116
"isDefault": true
@@ -22,7 +27,17 @@
2227
"script": "esbuild",
2328
"path": "packages/cursorless-vscode",
2429
"presentation": {
25-
"reveal": "never"
30+
"reveal": "silent"
31+
},
32+
"group": "build"
33+
},
34+
{
35+
"label": "Build test harness",
36+
"type": "npm",
37+
"script": "build",
38+
"path": "packages/test-harness",
39+
"presentation": {
40+
"reveal": "silent"
2641
},
2742
"group": "build"
2843
},
@@ -32,7 +47,7 @@
3247
"script": "compile",
3348
"problemMatcher": "$tsc",
3449
"presentation": {
35-
"reveal": "never"
50+
"reveal": "silent"
3651
},
3752
"group": "build"
3853
},
@@ -42,7 +57,7 @@
4257
"script": "populate-dist",
4358
"path": "packages/cursorless-vscode",
4459
"presentation": {
45-
"reveal": "never"
60+
"reveal": "silent"
4661
},
4762
"group": "build"
4863
},
@@ -73,9 +88,25 @@
7388
"dependsOrder": "sequence",
7489
"group": "test"
7590
},
91+
{
92+
"label": "watch",
93+
"dependsOn": ["Watch esbuild", "Watch typescript"],
94+
"group": "build"
95+
},
96+
{
97+
"type": "npm",
98+
"script": "watch:esbuild",
99+
"label": "Watch esbuild",
100+
"isBackground": true,
101+
"presentation": {
102+
"reveal": "never"
103+
},
104+
"group": "build"
105+
},
76106
{
77107
"type": "npm",
78-
"script": "watch",
108+
"script": "watch:tsc",
109+
"label": "Watch typescript",
79110
"problemMatcher": "$tsc-watch",
80111
"isBackground": true,
81112
"presentation": {

docs/user/installation.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
Clone repo into `~/.talon/user`
1717

18-
```insert code:
18+
```bash
1919
cd ~/.talon/user
2020
git clone https://github.com/cursorless-dev/cursorless-talon.git cursorless-talon
2121
```
@@ -24,7 +24,7 @@ Alternatively, access the directory by right clicking the Talon icon in taskbar,
2424

2525
The folder structure should look something like the below:
2626

27-
```insert code:
27+
```
2828
~/.talon/user/community
2929
~/.talon/user/community/apps
3030
~/.talon/user/community/code
@@ -40,7 +40,7 @@ Now, restart Talon.
4040

4141
Clone repo into `%AppData%\Talon\user`
4242

43-
```insert code:
43+
```bash
4444
cd %AppData%\Talon\user
4545
git clone https://github.com/cursorless-dev/cursorless-talon.git cursorless-talon
4646
```
@@ -49,7 +49,7 @@ Alternatively, access the directory by right clicking the Talon icon in taskbar,
4949

5050
The folder structure should look something like the below:
5151

52-
```insert code:
52+
```
5353
%AppData%\Talon\user\community
5454
%AppData%\Talon\user\community\apps
5555
%AppData%\Talon\user\community\code

package.json

+16-9
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"build": "pnpm -r build",
88
"clean": "pnpm -r clean",
9-
"compile": "tsc --build",
9+
"compile": "tsc --build && pnpm -r --if-present compile:esbuild",
1010
"fix:eslint": "pnpm lint:ts --fix",
1111
"fix:meta": "pnpm run meta-updater:base && pnpm -r exec prettier --write tsconfig.json package.json",
1212
"fix:syncpack": "pnpm syncpack fix-mismatches",
@@ -18,30 +18,33 @@
1818
"preinstall": "npx only-allow pnpm",
1919
"test-compile": "tsc --build",
2020
"test": "pnpm compile && pnpm lint && pnpm -F '!test-harness' test && pnpm -F test-harness test",
21-
"transform-recorded-tests": "tsx --conditions=cursorless:bundler packages/cursorless-engine/src/scripts/transformRecordedTests/index.ts",
22-
"watch": "tsc --build --watch"
21+
"transform-recorded-tests": "./packages/common/scripts/my-ts-node.js packages/cursorless-engine/src/scripts/transformRecordedTests/index.ts",
22+
"watch": "pnpm run -w --parallel '/^watch:.*/'",
23+
"watch:esbuild": "pnpm run -r --parallel --if-present watch:esbuild",
24+
"watch:tsc": "tsc --build --watch"
2325
},
2426
"keywords": [],
2527
"author": "",
2628
"license": "MIT",
2729
"devDependencies": {
2830
"@pnpm/meta-updater": "1.0.0",
29-
"@types/node": "^16.11.3",
31+
"@types/node": "^18.18.2",
3032
"@typescript-eslint/eslint-plugin": "^6.9.0",
3133
"@typescript-eslint/parser": "^6.9.0",
32-
"eslint": "^8.38.0",
34+
"esbuild": "^0.17.11",
35+
"eslint": "^8.53.0",
3336
"eslint-config-prettier": "^8.8.0",
3437
"eslint-import-resolver-typescript": "3.5.5",
3538
"eslint-plugin-import": "2.28.1",
39+
"eslint-plugin-unicorn": "49.0.0",
3640
"eslint-plugin-unused-imports": "^3.0.0",
3741
"prettier": "3.0.3",
3842
"syncpack": "9.8.4",
39-
"tsx": "3.12.3",
40-
"typescript": "^5.1.6"
43+
"typescript": "^5.2.2"
4144
},
4245
"pnpm": {
4346
"patchedDependencies": {
44-
"@docusaurus/[email protected]-alpha.0": "patches/@[email protected]"
47+
"@docusaurus/[email protected]": "patches/@[email protected]"
4548
},
4649
"peerDependencyRules": {
4750
"ignoreMissing": [
@@ -53,5 +56,9 @@
5356
}
5457
}
5558
},
56-
"packageManager": "[email protected]"
59+
"engines": {
60+
"node": ">=18.18.2"
61+
},
62+
"packageManager": "[email protected]",
63+
"type": "module"
5764
}

packages/cheatsheet-local/package.json

+14-7
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
"scripts": {
88
"compile": "tsc --build",
99
"watch": "tsc --build --watch",
10-
"webpack": "pnpm compile && webpack --config ./src/webpack.config.ts",
10+
"webpack": "pnpm -w compile && env NODE_OPTIONS=--loader=ts-node/esm webpack --config ./src/webpack.config.ts",
1111
"build": "pnpm build:prod",
1212
"build:dev": "pnpm webpack --mode=development",
1313
"build:prod": "pnpm webpack --mode=production --node-env=production",
14-
"clean": "rm -rf ./out tsconfig.tsbuildinfo"
14+
"clean": "rm -rf ./out tsconfig.tsbuildinfo ./dist ./build"
1515
},
1616
"keywords": [],
1717
"author": "",
@@ -32,7 +32,7 @@
3232
"@effortlessmotion/html-webpack-inline-source-plugin": "1.0.3",
3333
"@testing-library/react": "14.0.0",
3434
"@types/jest": "29.4.0",
35-
"@types/node": "^16.11.3",
35+
"@types/node": "^18.18.2",
3636
"@types/react": "18.0.28",
3737
"@types/react-dom": "18.0.11",
3838
"@types/webpack": "5.28.0",
@@ -44,12 +44,19 @@
4444
"postcss": "8.4.31",
4545
"postcss-loader": "7.0.2",
4646
"style-loader": "3.3.1",
47-
"tailwindcss": "3.2.7",
47+
"tailwindcss": "3.3.5",
4848
"ts-loader": "9.4.2",
4949
"ts-node": "10.9.1",
50-
"typescript": "^5.1.6",
51-
"webpack": "5.88.2",
50+
"typescript": "^5.2.2",
51+
"webpack": "5.89.0",
5252
"webpack-cli": "5.1.4",
5353
"webpack-dev-server": "4.11.1"
54-
}
54+
},
55+
"postcss": {
56+
"plugins": {
57+
"tailwindcss": {},
58+
"autoprefixer": {}
59+
}
60+
},
61+
"type": "module"
5562
}

packages/cheatsheet-local/postcss.config.js

-3
This file was deleted.

packages/cheatsheet-local/src/webpack.config.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ const config: Configuration = {
3838
test: /\.(ts|tsx)$/i,
3939
loader: "ts-loader",
4040
exclude: ["/node_modules/"],
41+
options: {
42+
compilerOptions: {
43+
noEmit: false,
44+
emitDeclarationOnly: false,
45+
},
46+
},
4147
},
4248
{
4349
test: /\.css$/i,
@@ -54,4 +60,4 @@ const config: Configuration = {
5460
},
5561
};
5662

57-
module.exports = () => config;
63+
export default () => config;

0 commit comments

Comments
 (0)