@backstage/cli-common
Advanced tools
Comparing version 0.0.0-nightly-20231017021237 to 0.0.0-nightly-20240607021723
# @backstage/cli-common | ||
## 0.0.0-nightly-20231017021237 | ||
## 0.0.0-nightly-20240607021723 | ||
### Patch Changes | ||
- de42eebaafc5: Bumped dev dependencies `@types/node` and `mock-fs`. | ||
- 142abb0: The monorepo root check in `findPaths` will now accept a shorthand `workspaces` config in `package.json`, no longer requiring `workspaces.packages`. | ||
## 0.1.13 | ||
### Patch Changes | ||
- de42eebaaf: Bumped dev dependencies `@types/node` and `mock-fs`. | ||
## 0.1.13-next.0 | ||
@@ -10,0 +16,0 @@ |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; } | ||
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); | ||
var fs__default = /*#__PURE__*/_interopDefaultCompat(fs); | ||
@@ -16,3 +14,3 @@ function findRootPath(searchDir, filterFunc) { | ||
const packagePath = path.resolve(path$1, "package.json"); | ||
const exists = fs__default["default"].existsSync(packagePath); | ||
const exists = fs__default.default.existsSync(packagePath); | ||
if (exists && filterFunc(packagePath)) { | ||
@@ -41,3 +39,3 @@ return path$1; | ||
function findOwnRootDir(ownDir) { | ||
const isLocal = fs__default["default"].existsSync(path.resolve(ownDir, "src")); | ||
const isLocal = fs__default.default.existsSync(path.resolve(ownDir, "src")); | ||
if (!isLocal) { | ||
@@ -52,3 +50,3 @@ throw new Error( | ||
const ownDir = findOwnDir(searchDir); | ||
const targetDir = fs__default["default"].realpathSync(process.cwd()).replace(/^[a-z]:/, (str) => str.toLocaleUpperCase("en-US")); | ||
const targetDir = fs__default.default.realpathSync(process.cwd()).replace(/^[a-z]:/, (str) => str.toLocaleUpperCase("en-US")); | ||
let ownRoot = ""; | ||
@@ -63,10 +61,8 @@ const getOwnRoot = () => { | ||
const getTargetRoot = () => { | ||
var _a; | ||
if (!targetRoot) { | ||
targetRoot = (_a = findRootPath(targetDir, (path) => { | ||
var _a2; | ||
targetRoot = findRootPath(targetDir, (path) => { | ||
try { | ||
const content = fs__default["default"].readFileSync(path, "utf8"); | ||
const content = fs__default.default.readFileSync(path, "utf8"); | ||
const data = JSON.parse(content); | ||
return Boolean((_a2 = data.workspaces) == null ? void 0 : _a2.packages); | ||
return Boolean(data.workspaces); | ||
} catch (error) { | ||
@@ -77,3 +73,3 @@ throw new Error( | ||
} | ||
})) != null ? _a : targetDir; | ||
}) ?? targetDir; | ||
} | ||
@@ -80,0 +76,0 @@ return targetRoot; |
@@ -47,2 +47,2 @@ /** | ||
export { BACKSTAGE_JSON, Paths, ResolveFunc, findPaths, isChildPath }; | ||
export { BACKSTAGE_JSON, type Paths, type ResolveFunc, findPaths, isChildPath }; |
{ | ||
"name": "@backstage/cli-common", | ||
"version": "0.0.0-nightly-20240607021723", | ||
"description": "Common functionality used by cli, backend, and create-app", | ||
"version": "0.0.0-nightly-20231017021237", | ||
"main": "dist/index.cjs.js", | ||
"types": "dist/index.d.ts", | ||
"backstage": { | ||
"role": "node-library" | ||
}, | ||
"publishConfig": { | ||
@@ -12,5 +13,5 @@ "access": "public", | ||
}, | ||
"backstage": { | ||
"role": "node-library" | ||
}, | ||
"keywords": [ | ||
"backstage" | ||
], | ||
"homepage": "https://backstage.io", | ||
@@ -22,22 +23,21 @@ "repository": { | ||
}, | ||
"keywords": [ | ||
"backstage" | ||
"license": "Apache-2.0", | ||
"main": "dist/index.cjs.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"license": "Apache-2.0", | ||
"scripts": { | ||
"build": "backstage-cli package build", | ||
"clean": "backstage-cli package clean", | ||
"lint": "backstage-cli package lint", | ||
"test": "backstage-cli package test", | ||
"prepack": "backstage-cli package prepack", | ||
"postpack": "backstage-cli package postpack", | ||
"clean": "backstage-cli package clean", | ||
"start": "backstage-cli package start" | ||
"start": "backstage-cli package start", | ||
"test": "backstage-cli package test" | ||
}, | ||
"devDependencies": { | ||
"@backstage/cli": "^0.0.0-nightly-20231017021237", | ||
"@backstage/cli": "^0.0.0-nightly-20240607021723", | ||
"@types/node": "^18.17.8" | ||
}, | ||
"files": [ | ||
"dist" | ||
] | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17345
142