Skip to content

Commit

Permalink
Yarn v4 (#968)
Browse files Browse the repository at this point in the history
* Explicitly specify `packageManager` as yarn v1

* Explicitly specify `packageManager` as yarn v4.1.0
Cache yarn release binary and use repo level module cache

* Add opt-in script for purging module cache (from npm and yarn)

* Add opt-in script for purging module cache (from npm and yarn)

* Run prettier, update remote tests for increased coverage

* Changeset

* Use `*` notation for interdependent packages in the workspace
  • Loading branch information
steveukx committed Feb 3, 2024
1 parent 65b9257 commit 9bfdf08
Show file tree
Hide file tree
Showing 15 changed files with 11,444 additions and 8,676 deletions.
5 changes: 5 additions & 0 deletions .changeset/honest-paws-cry.md
@@ -0,0 +1,5 @@
---
"simple-git": minor
---

Bump package manager from yarn v1 to v4
10 changes: 10 additions & 0 deletions .gitignore
@@ -1,9 +1,19 @@
.idea/
.DS_Store

node_modules/
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

coverage/
dist/
*.bak
*.log
*.tsbuildinfo

package-lock.json
893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.1.0.cjs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions .yarnrc.yml
@@ -0,0 +1,5 @@
enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.1.0.cjs
9 changes: 6 additions & 3 deletions package.json
Expand Up @@ -7,17 +7,20 @@
"simple-git"
],
"resolutions": {
"typescript": "4.7.4"
"typescript": "4.7.4",
"jest": "29.7.0"
},
"scripts": {
"build": "lerna run build",
"clean": "git clean -fxd -e .idea -e node_modules",
"clean": "git clean -fxd -e .idea -e node_modules -e .yarn",
"clean:cache": "git clean -fxd .yarn node_modules packages simple-git",
"test": "lerna run test"
},
"dependencies": {
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.2",
"lerna": "^8.0.1",
"prettier": "^3.0.1"
}
},
"packageManager": "yarn@4.1.0"
}
2 changes: 1 addition & 1 deletion packages/test-es-module-consumer/package.json
Expand Up @@ -7,7 +7,7 @@
"test": "node test.mjs"
},
"dependencies": {
"simple-git": "^3.10.0"
"simple-git": "*"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/test-javascript-consumer/package.json
Expand Up @@ -6,7 +6,7 @@
"test": "node test.js && node test-default.js"
},
"dependencies": {
"simple-git": "^3.10.0"
"simple-git": "*"
},
"repository": {
"type": "git",
Expand Down
7 changes: 5 additions & 2 deletions packages/test-typescript-consumer/package.json
Expand Up @@ -16,12 +16,15 @@
"test:jest": "jest"
},
"dependencies": {
"@simple-git/babel-config": "^1.0.0",
"simple-git": "^3.10.0"
"@simple-git/babel-config": "*",
"simple-git": "*"
},
"repository": {
"type": "git",
"url": "https://github.com/steveukx/git-js.git",
"directory": "packages/test-typescript-consumer"
},
"devDependencies": {
"jest": "^29.7.0"
}
}
4 changes: 2 additions & 2 deletions packages/test-typescript-consumer/tsconfig.json
Expand Up @@ -8,7 +8,7 @@
"baseUrl": ".",
"paths": {},
"esModuleInterop": false,
"allowSyntheticDefaultImports": false
"allowSyntheticDefaultImports": false,
},
"files": ["test/ts-default-from-root.spec.ts"]
"files": ["test/ts-default-from-root.spec.ts"],
}
7 changes: 5 additions & 2 deletions packages/test-typescript-esm-consumer/package.json
Expand Up @@ -14,12 +14,15 @@
"test": "jest"
},
"dependencies": {
"@simple-git/babel-config": "^1.0.0",
"simple-git": "^3.10.0"
"@simple-git/babel-config": "*",
"simple-git": "*"
},
"repository": {
"type": "git",
"url": "https://github.com/steveukx/git-js.git",
"directory": "packages/test-typescript-consumer"
},
"devDependencies": {
"jest": "^29.7.0"
}
}
4 changes: 2 additions & 2 deletions packages/test-typescript-esm-consumer/tsconfig.json
Expand Up @@ -5,7 +5,7 @@
"moduleResolution": "node16",
"noEmit": true,
"allowSyntheticDefaultImports": true,
"baseUrl": "."
"baseUrl": ".",
// "emitDecoratorMetadata": true,
// "experimentalDecorators": true,
// "forceConsistentCasingInFileNames": true,
Expand All @@ -18,5 +18,5 @@
// "sourceMap": true,
// "strictBindCallApply": true,
// "strictNullChecks": false,
}
},
}
2 changes: 1 addition & 1 deletion packages/test-utils/package.json
Expand Up @@ -3,6 +3,6 @@
"version": "4.0.0",
"private": true,
"peerDependencies": {
"simple-git": "^3.22.0"
"simple-git": "*"
}
}
6 changes: 3 additions & 3 deletions simple-git/src/lib/tasks/remote.ts
Expand Up @@ -5,7 +5,7 @@ import { straightThroughStringTask } from './task';
export function addRemoteTask(
remoteName: string,
remoteRepo: string,
customArgs: string[] = []
customArgs: string[]
): StringTask<string> {
return straightThroughStringTask(['remote', 'add', ...customArgs, remoteName, remoteRepo]);
}
Expand All @@ -23,7 +23,7 @@ export function getRemotesTask(verbose: boolean): StringTask<any> {
};
}

export function listRemotesTask(customArgs: string[] = []): StringTask<string> {
export function listRemotesTask(customArgs: string[]): StringTask<string> {
const commands = [...customArgs];
if (commands[0] !== 'ls-remote') {
commands.unshift('ls-remote');
Expand All @@ -32,7 +32,7 @@ export function listRemotesTask(customArgs: string[] = []): StringTask<string> {
return straightThroughStringTask(commands);
}

export function remoteTask(customArgs: string[] = []): StringTask<string> {
export function remoteTask(customArgs: string[]): StringTask<string> {
const commands = [...customArgs];
if (commands[0] !== 'remote') {
commands.unshift('remote');
Expand Down
6 changes: 3 additions & 3 deletions simple-git/tsconfig.json
Expand Up @@ -26,14 +26,14 @@
"declarationMap": false,
"sourceMap": true,
"paths": {},
"noEmit": true
"noEmit": true,
},
"exclude": ["node_modules"],
"include": [
"src/lib/**/*.ts",
"test/__fixtures__/**/*.ts",
"test/integration/**/*.ts",
"test/unit/**/*.ts",
"typings/index.d.ts"
]
"typings/index.d.ts",
],
}

0 comments on commit 9bfdf08

Please sign in to comment.