Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

workspace-tools

Package Overview
Dependencies
Maintainers
2
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workspace-tools - npm Package Compare versions

Comparing version 0.24.0 to 0.25.0

17

CHANGELOG.json

@@ -5,3 +5,18 @@ {

{
"date": "Wed, 20 Jul 2022 22:31:28 GMT",
"date": "Thu, 21 Jul 2022 21:11:05 GMT",
"tag": "workspace-tools_v0.25.0",
"version": "0.25.0",
"comments": {
"minor": [
{
"author": "dlannoye@microsoft.com",
"package": "workspace-tools",
"comment": "BREAKING CHANGE: Improve detection of git root and throw if not found",
"commit": "00be591c06d9c14eba7f2b76cb8aac5f0246fdec"
}
]
}
},
{
"date": "Wed, 20 Jul 2022 22:31:31 GMT",
"tag": "workspace-tools_v0.24.0",

@@ -8,0 +23,0 @@ "version": "0.24.0",

# Change Log - workspace-tools
This log was last generated on Wed, 20 Jul 2022 22:31:28 GMT and should not be manually modified.
This log was last generated on Thu, 21 Jul 2022 21:11:05 GMT and should not be manually modified.
<!-- Start content -->
## 0.25.0
Thu, 21 Jul 2022 21:11:05 GMT
### Minor changes
- BREAKING CHANGE: Improve detection of git root and throw if not found (dlannoye@microsoft.com)
## 0.24.0
Wed, 20 Jul 2022 22:31:28 GMT
Wed, 20 Jul 2022 22:31:31 GMT

@@ -11,0 +19,0 @@ ### Minor changes

3

lib/git/getDefaultRemote.js

@@ -23,5 +23,2 @@ "use strict";

const gitRoot = (0, paths_1.findGitRoot)(cwd);
if (!gitRoot) {
throw new Error(`Directory "${cwd}" does not appear to be in a git repository`);
}
let packageJson = {};

@@ -28,0 +25,0 @@ const packageJsonPath = path_1.default.join(gitRoot, "package.json");

@@ -6,5 +6,6 @@ /**

/**
* Starting from `cwd`, searches up the directory hierarchy for `.git`.
* Starting from `cwd`, uses `git rev-parse --show-toplevel` to find the root of the git repo.
* Throws if `cwd` is not in a Git repository.
*/
export declare function findGitRoot(cwd: string): string | null;
export declare function findGitRoot(cwd: string): string;
/**

@@ -18,3 +19,3 @@ * Starting from `cwd`, searches up the directory hierarchy for `package.json`.

*/
export declare function findProjectRoot(cwd: string): string | null;
export declare function findProjectRoot(cwd: string): string;
export declare function isChildOf(child: string, parent: string): boolean;

@@ -10,2 +10,3 @@ "use strict";

const getWorkspaceRoot_1 = require("./workspaces/getWorkspaceRoot");
const git_1 = require("./git");
/**

@@ -31,6 +32,11 @@ * Starting from `cwd`, searches up the directory hierarchy for `pathName`.

/**
* Starting from `cwd`, searches up the directory hierarchy for `.git`.
* Starting from `cwd`, uses `git rev-parse --show-toplevel` to find the root of the git repo.
* Throws if `cwd` is not in a Git repository.
*/
function findGitRoot(cwd) {
return searchUp(".git", cwd);
const output = (0, git_1.git)(["rev-parse", "--show-toplevel"], { cwd });
if (!output.success) {
throw new Error(`Directory "${cwd}" is not in a git repository`);
}
return path_1.default.normalize(output.stdout);
}

@@ -37,0 +43,0 @@ exports.findGitRoot = findGitRoot;

{
"name": "workspace-tools",
"version": "0.24.0",
"version": "0.25.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc