Skip to content

Commit 2581926

Browse files
authored
chore: update yarn to latest version (4.4.0) (#199)
Updated yarn to the latest version 4.4.0 (yarn berry) Had to resort to using the yarn pack workaround, there seems to be an issue with yarn file: protocol when the dependency is pointing to the top directory yarnpkg/berry#3580 (comment) There is a very noticeable performance improvement on CI when running the tests, especially on windows | master | yarn 4 | |--------|--------| | ![image](https://github.com/user-attachments/assets/65ac8d57-8f82-495a-8e4f-1ddec09ee53a) | ![image](https://github.com/user-attachments/assets/db4b2170-5860-4a01-95a0-a3836bb7fc8c) |
1 parent 2e0d861 commit 2581926

File tree

10 files changed

+11732
-8294
lines changed

10 files changed

+11732
-8294
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727
- uses: actions/checkout@v4
2828

29-
- run: corepack enable
29+
- run: corepack enable ${{ matrix.os == 'windows-latest' && '--install-directory C:\npm\prefix' || '' }}
3030

3131
- name: Use Node.js ${{ matrix.node-version }}
3232
uses: actions/setup-node@v4
@@ -35,13 +35,18 @@ jobs:
3535
cache: yarn
3636
cache-dependency-path: "**/yarn.lock"
3737

38-
- run: yarn install --frozen-lockfiles
38+
- run: yarn install
3939

4040
- run: yarn build
4141

42+
- name: Generate package archive
43+
run: yarn pack
44+
4245
- name: Install dependencies for testing
43-
run: yarn install --frozen-lockfiles
46+
run: yarn install
4447
working-directory: test
48+
env:
49+
YARN_ENABLE_IMMUTABLE_INSTALLS: false
4550

4651
- name: Test
4752
working-directory: test

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
cache-dependency-path: "**/yarn.lock"
2222

2323
- name: Install Packages
24-
run: yarn install --frozen-lockfile
24+
run: yarn install
2525

2626
- name: Build
2727
run: yarn build

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ fabric.properties
7676
# Editor-based Rest Client
7777
.idea/httpRequests
7878

79-
test/out.tgz
79+
package.tgz

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

package.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@
66
"types": "types/index.d.ts",
77
"scripts": {
88
"compile": "tsc",
9-
"build": "yarn run clean && yarn run compile",
10-
"test": "yarn --cwd test test",
9+
"build": "rm -rf dist && yarn run clean && yarn run compile",
10+
"test": "yarn test/ install && yarn test/ add-package && yarn test/ test",
1111
"release": "standard-version",
1212
"--------------": "",
1313
"format": "prettier --write .",
14-
"clean": "rimraf -g dist \"**/*.tsbuildinfo\" ./test/projects/nx/dist",
15-
"clean:all": "yarn run clean && rimraf -g node_modules \"**/node_modules\" \"**/yarn.lock\" yarn.lock",
14+
"clean": "rm -rf dist \"**/*.tsbuildinfo\" ./test/projects/nx/dist",
15+
"clean:all": "yarn run clean && rm -rf node_modules \"**/node_modules\" \"**/yarn.lock\" yarn.lock",
1616
"reset": "yarn run clean:all && yarn install && yarn build",
1717
"-------------- ": "",
18-
"prepack": "yarn build",
19-
"pretest": "yarn --cwd test install",
20-
"prebuild": "rimraf -g dist"
18+
"prepack": "yarn build"
2119
},
2220
"keywords": [
2321
"typescript",
@@ -58,10 +56,9 @@
5856
"@types/minimatch": "^5.1.2",
5957
"@types/node": "^18.19.43",
6058
"@types/ts-expose-internals": "npm:ts-expose-internals@4.9.5",
59+
"@types/ts-node": "npm:ts-node@^10.9.2",
6160
"prettier": "^3.3.3",
62-
"rimraf": "^5.0.10",
6361
"standard-version": "^9.5.0",
64-
"@types/ts-node": "npm:ts-node@^10.9.2",
6562
"ts-patch": "^3.2.1",
6663
"typescript": "^5.5.4"
6764
},
@@ -71,5 +68,5 @@
7168
"dependencies": {
7269
"minimatch": "^3.1.2"
7370
},
74-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
71+
"packageManager": "yarn@4.4.0+sha512.91d93b445d9284e7ed52931369bc89a663414e5582d00eea45c67ddc459a2582919eece27c412d6ffd1bd0793ff35399381cb229326b961798ce4f4cc60ddfdb"
7572
}

test/package.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"license": "MIT",
44
"scripts": {
55
"test": "jest",
6-
"prepare": "node prepare.js"
6+
"g:ts-node": "cd $INIT_CWD && ts-node",
7+
"add-package": "yarn ../ pack && yarn add ../package.tgz",
8+
"postinstall": "node prepare.js"
79
},
810
"devDependencies": {
911
"@nrwl/cli": "^15.9.7",
@@ -23,15 +25,9 @@
2325
"typescript": "^5.5.4",
2426
"typescript-four-seven": "npm:typescript@4.7.4",
2527
"typescript-three": "npm:typescript@3.6.5",
26-
"typescript-transform-paths": "file:../"
28+
"typescript-transform-paths": "../package.tgz"
2729
},
28-
"workspaces": {
29-
"packages": [
30-
"projects/*"
31-
],
32-
"nohoist": [
33-
"**/semver/*",
34-
"**/ts-patch/*"
35-
]
36-
}
30+
"workspaces": [
31+
"projects/*"
32+
]
3733
}

test/tests/extras.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ describe(`Extra Tests`, () => {
3636

3737
describe(`ts-node register script`, () => {
3838
test(`Works with --transpileOnly`, () => {
39-
const res = execSync("yarn run --silent ts-node --transpileOnly src/index.ts", { cwd: projectRoot }).toString();
39+
const res = execSync("yarn g:ts-node --transpileOnly src/index.ts", { cwd: projectRoot }).toString();
4040
expect(stripAnsi(res)).toMatch(/^null($|\r?\n)/m);
4141
});
4242

4343
test(`Works with --typeCheck`, () => {
44-
const res = execSync("yarn run --silent ts-node --typeCheck src/index.ts", { cwd: projectRoot }).toString();
44+
const res = execSync("yarn g:ts-node --typeCheck src/index.ts", { cwd: projectRoot }).toString();
4545
expect(stripAnsi(res)).toMatch(/^null($|\r?\n)/);
4646
});
4747
});

0 commit comments

Comments
 (0)